1;(function($){ 2 $.fn.extend({ 3 jaccordion_expand: function(options){ 4 $context = $(this); 5 // if ( $context.hasClass(options.active_class) ) { 6 // //return; 7 // } 8 var $content_inner = $(options.content, $context); 9 $content_inner.filter(':animated').stop(); 10 11 $height_to_fit = 0; 12 $content_inner.children().each(function(){ 13 if ($(this).height()>0){ 14 $height_to_fit += $(this).height(); 15 } 16 }); 17 18 $context.addClass(options.active_class); 19 $content_inner.animate({ 20 height: $height_to_fit 21 }, { 22 duration: options.duration, 23 complete: function(){ 24 $content_inner.css('height','auto'); 25 } 26 }); 27 }, 28 jaccordion_close: function(options){ 29 $context = $(this); 30 $context.removeClass(options.active_class); 31 var $content_inner = $(options.content, $context); 32 33 $content_inner.filter(':animated').stop(); 34 35 $content_inner.animate({ 36 height: 0 37 }, { 38 duration: options.duration 39 }); 40 }, 41 jaccordion: function(options){ 42 var defaults = {}; 43 var options = $.extend(defaults, options); 44 45 return this.each(function(){ 46 var panel = $(this); 47 var items = $(options.items, this); 48 var stack = []; 49 var stackProcess = function(){ 50 if (stack.length>0){ 51 var item = stack.pop(); 52 items.not(item).jaccordion_close(options); 53 if($(item).hasClass(options.active_class)){ 54 $(item).jaccordion_close(options); 55 }else{ 56 $(item).jaccordion_expand(options); 57 } 58 59 } 60 }; 61 var stackTimeout = null; 62 items.each(function(i, item){ 63 if (options.active && options.active==(i+1)){ 64 $(item).jaccordion_expand(options); 65 } 66 67 if (options.event=='click'){ 68 $(options.heading,$(item)).click(function(){ 69 items.not(item).jaccordion_close(options); 70 if($(item).hasClass(options.active_class)){ 71 $(item).jaccordion_close(options); 72 }else{ 73 $(item).jaccordion_expand(options); 74 } 75 }); 76 } else { 77 var delay = parseInt(options.delay); 78 if (!delay) delay = 100; 79 $(options.heading,$(item)).hover(function(){ 80 if (stackTimeout){ 81 clearTimeout(stackTimeout); 82 } 83 stackTimeout = setTimeout(stackProcess, delay); 84 stack.push(item); 85 }, function(){ 86 stack.pop(); 87 }); 88 } 89 }); 90 }); 91 } 92 }); 93})(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.