1(function(jQuery){ 2 jQuery.fn.extend({ 3 accordion: function() { 4 return this.each(function() { 5 6 var $ul = $(this); 7 8 if($ul.data('accordiated')) 9 return false; 10 11 $.each($ul.find('ul, li>div'), function(){ 12 $(this).data('accordiated', true); 13 $(this).hide(); 14 }); 15 $.each($ul.find('a'), function(){ 16 $(this).click(function(e){ 17 activate(this); 18 return void(0); 19 }); 20 }); 21 22 var active = (location.hash)?$(this).find('a[href=' + location.hash + ']')[0]:''; 23 24 if(active){ 25 activate(active, 'toggle'); 26 $(active).parents().show(); 27 } 28 if ($(".accordion li").hasClass("active")){ 29 $(".accordion li.active").parents('ul').not(".accordion").show(); 30 $(".accordion li.active").parents('li').addClass("active"); 31 32 var elem = $(".accordion ul li, .accordion>li").has("ul"); 33 elem.children('a').addClass("used"); 34 elem.children('a').click(function(){ 35 return false; 36 }); 37 } 38 function activate(el,effect){ 39 $(el).parent('li').toggleClass('active').siblings().removeClass('active').children('ul, div').slideUp('fast'); 40 $(el).siblings('ul, div')[(effect || 'slideToggle')]((!effect)?'fast':null); 41 } 42 43 }); 44 } 45 }); 46})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.