docs.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. $(function(){
  2. // init multi-vers stuff
  3. $('.tabswitcher').each(function(i, multi_vers){
  4. var tabs = $('<ul></ul>');
  5. $(multi_vers).prepend(tabs);
  6. $(multi_vers).children('.tab').each(function(j, vers_content){
  7. vers = $(vers_content).children(':first').text();
  8. var id = 'multi_vers_' + '_' + i + '_' + j;
  9. $(vers_content).attr('id', id);
  10. $(tabs).append('<li><a href="#' + id + '">' + vers + '</a></li>');
  11. });
  12. });
  13. $( ".tabswitcher" ).tabs();
  14. // sidebar acordian-ing
  15. // don't apply on last object (it should be the FAQ)
  16. $('nav > ul > li > a').not(':last').click(function(){
  17. if ($(this).parent().hasClass('current')) {
  18. $(this).parent().children('ul').slideUp(200, function() {
  19. $(this).parent().removeClass('current'); // toggle after effect
  20. });
  21. } else {
  22. $('nav > ul > li > ul').slideUp(100);
  23. var current = $(this);
  24. setTimeout(function() {
  25. $('nav > ul > li').removeClass('current');
  26. current.parent().addClass('current'); // toggle before effect
  27. current.parent().children('ul').hide();
  28. current.parent().children('ul').slideDown(200);
  29. }, 100);
  30. }
  31. return false;
  32. });
  33. });