1(function($) { 2 3 $.organicTabs = function(el, options) { 4 5 var base = this; 6 base.$el = $(el); 7 base.$nav = base.$el.find(".nav"); 8 9 base.init = function() { 10 11 base.options = $.extend({},$.organicTabs.defaultOptions, options); 12 13 // Accessible hiding fix 14 $(".hide").css({ 15 "position": "relative", 16 "top": 0, 17 "left": 0, 18 "display": "none" 19 }); 20 21 base.$nav.delegate("li > a", "click", function() { 22 23 // Figure out current list via CSS class 24 var curList = base.$el.find("a.current").attr("href").substring(1), 25 26 // List moving to 27 $newList = $(this), 28 29 // Figure out ID of new list 30 listID = $newList.attr("href").substring(1), 31 32 // Set outer wrapper height to (static) height of current inner list 33 $allListWrap = base.$el.find(".list-wrap"), 34 curListHeight = $allListWrap.height(); 35 $allListWrap.height(curListHeight); 36 37 if ((listID != curList) && ( base.$el.find(":animated").length == 0)) { 38 39 // Fade out current list 40 base.$el.find("#"+curList).fadeOut(base.options.speed, function() { 41 42 // Fade in new list on callback 43 base.$el.find("#"+listID).fadeIn(base.options.speed); 44 45 // Adjust outer wrapper to fit new list snuggly 46 var newHeight = base.$el.find("#"+listID).height(); 47 $allListWrap.animate({ 48 height: newHeight 49 }); 50 51 // Remove highlighting - Add to just-clicked tab 52 base.$el.find(".nav li a").removeClass("current"); 53 $newList.addClass("current"); 54 55 }); 56 57 } 58 59 // Don't behave like a regular link 60 // Stop propegation and bubbling 61 return false; 62 }); 63 64 }; 65 base.init(); 66 }; 67 68 $.organicTabs.defaultOptions = { 69 "speed": 300 70 }; 71 72 $.fn.organicTabs = function(options) { 73 return this.each(function() { 74 (new $.organicTabs(this, options)); 75 }); 76 }; 77 78})(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.