1/** 2* MediaQuery MultiDevice Template ver 0.1���� 3* @Author: funnythingz 4* @Url: http://hiropo.co.uk 5* 6* jquery-megaDropdown.js 7*/ 8 9(function($){ 10 $.fn.megaDropdown = function(config){ 11 var defaults = { 12 effectSpeed: 250 13 } 14 var options = $.extend(defaults, config); 15 return this.each(function(i){ 16 var self = $(this); 17 var contents = $('.gnaviChildCol', self); 18 var bgClass = 'megaDropdownOver'; 19 20 contents.hide(); 21 self.bind('mouseenter mouseleave', i, function(e){ 22 if( $(window).width() > 581 ){ 23 if( e.type === 'mouseenter' ){ 24 contents.stop(true, true).fadeIn(options.effectSpeed); 25 self.addClass(bgClass); 26 } 27 else if( e.type === 'mouseleave' ){ 28 contents.hide(); 29 self.removeClass(bgClass); 30 } 31 } 32 }); 33 }); 34 }; 35 36 //Calculate width of all ul's 37 $.fn.calcSubWidth = function() { 38 rowWidth = 0; 39 //Calculate row 40 $(this).find("ul").each(function() { 41 rowWidth += $(this).width(); 42 }); 43 }; 44 45 function megaHoverOver(){ 46 $(this).find(".sub").stop().fadeTo('fast', 1).show(); 47 48 if ( $(this).find(".row").length > 0 ) { //If row exists... 49 var biggestRow = 0; 50 //Calculate each row 51 $(this).find(".row").each(function() { 52 $(this).calcSubWidth(); 53 //Find biggest row 54 if(rowWidth > biggestRow) { 55 biggestRow = rowWidth; 56 } 57 }); 58 //Set width 59 $(this).find(".sub").css({'width' :biggestRow}); 60 $(this).find(".row:last").css({'margin':'0'}); 61 62 } else { //If row does not exist... 63 64 $(this).calcSubWidth(); 65 //Set Width 66 $(this).find(".sub").css({'width' : rowWidth}); 67 68 } 69 } 70 71 function megaHoverOut(){ 72 $(this).find(".sub").stop().fadeTo('fast', 0, function() { 73 $(this).hide(); 74 }); 75 } 76 77 $(document).ready(function() { 78 79 var config = { 80 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) 81 interval: 100, // number = milliseconds for onMouseOver polling interval 82 over: megaHoverOver, // function = onMouseOver callback (REQUIRED) 83 timeout: 500, // number = milliseconds delay before onMouseOut 84 out: megaHoverOut // function = onMouseOut callback (REQUIRED) 85 }; 86 87 $("ul#topnav li .sub").css({'opacity':'0'}); 88 $("ul#topnav li").hoverIntent(config); 89 90 }); 91})(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.