1/* 2 * Superfish v1.4.8 - jQuery menu widget 3 * Copyright (c) 2008 Joel Birch 4 * 5 * Dual licensed under the MIT and GPL licenses: 6 * http://www.opensource.org/licenses/mit-license.php 7 * http://www.gnu.org/licenses/gpl.html 8 * 9 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 10 */ 11 12;(function($){ 13 $.fn.superfish = function(op){ 14 var sf = $.fn.superfish, 15 c = sf.c, 16 $arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')), 17 over = function(){ 18 var $$ = $(this), menu = getMenu($$); 19 clearTimeout(menu.sfTimer); 20 21 if(op.rollOverType == 'wave') 22 $('>a', this).stop().animate({backgroundPosition: "(-20px 94px)"}, {duration:500}); 23 else if(op.rollOverType == 'driveIn') 24 $('>a', this).stop().animate({backgroundPosition: "(-150px 0)"}, {duration:500}); 25 else if(op.rollOverType == 'fadeIn') 26 $('>a', this).stop().animate({backgroundPosition: "(0 -51px)"}, {duration:1}); 27 else if(op.rollOverType == 'simple') 28 $('>a', this).css({backgroundPosition: "-150px 0"}); 29 30 $$.showSuperfishUl().siblings().hideSuperfishUl(); 31 }, 32 out = function(){ 33 var $$ = $(this), menu = getMenu($$), o = sf.op; 34 clearTimeout(menu.sfTimer); 35 36 if(op.rollOverType == 'wave') 37 $('>a', this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){$(this).css({backgroundPosition: "-20px 35px"})}}); 38 else if(op.rollOverType == 'driveIn') 39 $('>a', this).stop().animate({backgroundPosition:"(-300px 0)"}, {duration:200, complete:function(){$(this).css({backgroundPosition: "0 0"})}}); 40 else if(op.rollOverType == 'fadeIn') 41 $('>a', this).stop().animate({backgroundPosition:"(0 0)"}, {duration:1, complete:function(){$(this).css({backgroundPosition: "0 0"})}}); 42 else if(op.rollOverType == 'simple') 43 $('>a', this).css({backgroundPosition: "0 0"}); 44 45 46 menu.sfTimer=setTimeout(function(){ 47 o.retainPath=($.inArray($$[0],o.$path)>-1); 48 $$.hideSuperfishUl(); 49 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 50 },o.delay); 51 }, 52 getMenu = function($menu){ 53 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 54 sf.op = sf.o[menu.serial]; 55 return menu; 56 }, 57 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 58 59 return this.each(function() { 60 var s = this.serial = sf.o.length; 61 var o = $.extend({},sf.defaults,op); 62 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ 63 $(this).addClass([o.hoverClass,c.bcClass].join(' ')) 64 .filter('li:has(ul)').removeClass(o.pathClass); 65 }); 66 sf.o[s] = sf.op = o; 67 68 $('li',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out) 69 .not('.'+c.bcClass) 70 .hideSuperfishUl(); 71 72 if(o.rollOverType=="wave") 73 $('li>a', this).css({background: "url(/template/menu/dropdown/bg.jpg) repeat -20px 35px"}).css({backgroundPosition: "-20px 35px"}); 74 else if(o.rollOverType=="driveIn") 75 $('li>a', this).css({background: "url(/template/menu/dropdown/bg2.jpg) repeat 0 0"}).css({backgroundPosition: "0 0"}); 76 else if(o.rollOverType=="fadeIn") 77 $('li>a', this).css({background: "url(/template/menu/dropdown/bg3.jpg) repeat 0 0"}).css({backgroundPosition: "0 0"}); 78 else if(o.rollOverType=="simple") 79 $('li>a', this).css({background: "url(/template/menu/dropdown/bg2.jpg) repeat 0 0"}).css({backgroundPosition: "0 0"}); 80 81 82 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 83 if (o.autoArrows) addArrow( $('>a:first-child',this) ); 84 85 }) 86 .not('.'+c.bcClass) 87 .hideSuperfishUl(); 88 89 90 var $a = $('a',this); 91 $a.each(function(i){ 92 var $li = $a.eq(i).parents('li'); 93 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 94 }); 95 o.onInit.call(this); 96 97 }).each(function() { 98 var menuClasses = [c.menuClass]; 99 if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); 100 $(this).addClass(menuClasses.join(' ')); 101 }); 102 }; 103 104 var sf = $.fn.superfish; 105 sf.o = []; 106 sf.op = {}; 107 sf.IE7fix = function(){ 108 var o = sf.op; 109 if ($.browser.msie && $.browser.version >
109 6 && o.dropShadows && o.animation.opacity!=undefined) 110 this.toggleClass(sf.c.shadowClass+'-off'); 111 }; 112 sf.c = { 113 bcClass : 'sf-breadcrumb', 114 menuClass : 'sf-js-enabled', 115 anchorClass : 'sf-with-ul', 116 arrowClass : 'sf-sub-indicator', 117 shadowClass : 'sf-shadow' 118 }; 119 sf.defaults = { 120 hoverClass : 'sfHover', 121 pathClass : 'overideThisToUse', 122 pathLevels : 1, 123 delay : 800, 124 animation : {opacity:'show'}, 125 speed : 'normal', 126 autoArrows : true, 127 dropShadows : true, 128 disableHI : false, // true disables hoverIntent detection 129 onInit : function(){}, // callback functions 130 onBeforeShow: function(){}, 131 onShow : function(){}, 132 onHide : function(){} 133 }; 134 $.fn.extend({ 135 hideSuperfishUl : function(){ 136 var o = sf.op, 137 not = (o.retainPath===true) ? o.$path : ''; 138 o.retainPath = false; 139 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 140 .find('>ul').hide().css('visibility','hidden'); 141 o.onHide.call($ul); 142 return this; 143 }, 144 showSuperfishUl : function(){ 145 var o = sf.op, 146 sh = sf.c.shadowClass+'-off', 147 $ul = this.addClass(o.hoverClass) 148 .find('>ul:hidden').css('visibility','visible'); 149 150 sf.IE7fix.call($ul); 151 o.onBeforeShow.call($ul); 152 153 if(o.animationType == 'slideDown') 154 $ul.slideDown(o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); 155 else 156 $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); 157 158 return this; 159 } 160 }); 161 162})(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.