1function viral_pro_build_mega_menu() { 2 var $container = jQuery('.ht-header .ht-container'); 3 4 jQuery('.ht-menu .menu-item-megamenu.megamenu-full-width').hover(function () { 5 var $menuWidth = $container.outerWidth(), 6 $menuPosition = $container.offset(), 7 $menuItemPosition = jQuery(this).offset(), 8 $PositionLeft = $menuItemPosition.left - $menuPosition.left; 9 10 jQuery(this).find('.megamenu').css({ 11 'left': '-' + $PositionLeft + 'px', 12 'width': $menuWidth 13 }); 14 }); 15 16 // Megamenu auto width 17 jQuery('.ht-menu .menu-item-megamenu.megamenu-auto-width .megamenu').each(function () { 18 var $li = jQuery(this).parent(), 19 $window_width = jQuery(window).width(), 20 $container = jQuery('.ht-header .ht-container'), 21 $containerWidth = $container.outerWidth(), 22 $containerOffset = $container.offset().left, 23 $liOffset = $li.offset().left, 24 $liWidth = $li.outerWidth(), 25 $dropdownWidth = jQuery(this).outerWidth(); 26 if (viral_pro_megamenu.rtl == 'true') { 27 if ($dropdownWidth < $liOffset + $liWidth - $containerOffset) { 28 jQuery(this).css({ 29 'right': 0, 30 'left': 'auto' 31 }); 32 } else { 33 var $excessWidth = $dropdownWidth - ($liOffset + $liWidth - $containerOffset) 34 jQuery(this).css({ 35 'right': -$excessWidth, 36 'left': 'auto', 37 }); 38 } 39 } else { 40 if ($dropdownWidth < $containerOffset + $containerWidth - $liOffset) { 41 jQuery(this).css({ 42 'left': 0, 43 'right': 'auto' 44 }); 45 } else { 46 if ($dropdownWidth < $liOffset + $liWidth - $containerOffset) { 47 jQuery(this).css({ 48 'right': 0, 49 'left': 'auto' 50 }); 51 } else { 52 var $excessWidth = $dropdownWidth - ($containerOffset + $containerWidth - $liOffset); 53 jQuery(this).css({ 54 'left': -$excessWidth, 55 'right': 'auto', 56 }); 57 58 } 59 } 60 } 61 }); 62 63 jQuery('li.heading-yes > a').on('click', function () { 64 return false; 65 }); 66 67 jQuery('.cat-megamenu-tab > div:first').addClass('active-tab'); 68 69 jQuery('.cat-megamenu-tab > div').hoverIntent(function () { 70 var $this = jQuery(this); 71 if ($this.hasClass('active-tab')) { 72 return; 73 } 74 75 $this.siblings().removeClass('active-tab'); 76 $this.addClass('active-tab'); 77 var activeCat = $this.data('catid'); 78 $this.closest('.megamenu').find('.cat-megamenu-content > ul').hide(); 79 $this.closest('.megamenu').find('#' + activeCat).fadeIn('fast'); 80 }); 81}
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.