![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/walla3t.corals.io/wp-content/themes/apper/assets/js/core/ |
var $j = jQuery.noConflict(), $window = $j( window ); $j( document ).on( 'ready', function() { "use strict"; // Mega menu acmthemesMegaMenu(); } ); /* ============================================== MEGA MENU ============================================== */ function acmthemesMegaMenu() { "use strict" // Mega menu in top bar menu $j( '#top-bar-nav .megamenu-li.full-mega' ).hover( function() { var $topBar = $j( '#top-bar' ), $menuWidth = $topBar.width(), $menuPosition = $topBar.offset(), $menuItemPosition = $j( this ).offset(), $positionLeft = $menuItemPosition.left-$menuPosition.left+1; if ( $j( 'body' ).hasClass( 'boxed-layout' ) ) { $positionLeft = $menuItemPosition.left-$menuPosition.left+1; $positionLeft = $positionLeft-30; } $j( this ).find( '.megamenu' ).css( { 'left': '-'+$positionLeft+'px', 'width': $menuWidth } ); } ); // Mega menu in principal menu $j( '#site-navigation .megamenu-li.full-mega' ).hover( function() { var $siteHeader = $j( '#site-header-inner' ), $menuWidth = $siteHeader.width(), $menuPosition = $siteHeader.offset(), $menuItemPosition = $j( this ).offset(), $positionLeft = $menuItemPosition.left-$menuPosition.left+1; if ( $j( '#site-header' ).hasClass( 'medium-header' ) ) { $siteHeader = $j( '#site-navigation-wrap > .container' ), $menuWidth = $siteHeader.width(), $menuPosition = $siteHeader.offset(), $positionLeft = $menuItemPosition.left-$menuPosition.left+1; } if ( $j( 'body' ).hasClass( 'boxed-layout' ) ) { $positionLeft = $menuItemPosition.left-$menuPosition.left+1; $positionLeft = $positionLeft-30; } $j( this ).find( '.megamenu' ).css( { 'left': '-'+$positionLeft+'px', 'width': $menuWidth } ); } ); // Megamenu auto width $j( '.navigation .megamenu-li.auto-mega .megamenu' ).each( function() { var $li = $j( this ).parent(), $liOffset = $li.offset().left, $liOffsetTop = $li.offset().top, $liWidth = $j( this ).parent().width(), $dropdowntMarginLeft = $liWidth/2, $dropdownWidth = $j( this ).outerWidth(), $dropdowntLeft = $liOffset - $dropdownWidth/2; if ( $dropdowntLeft < 0 ) { var $left = $liOffset - 10; $dropdowntMarginLeft = 0; } else { var $left = $dropdownWidth/2; } if ( acmthemesLocalize.isRTL ) { $j( this ).css( { 'right': - $left, 'marginRight': $dropdowntMarginLeft } ); } else { $j( this ).css( { 'left': - $left, 'marginLeft': $dropdowntMarginLeft } ); } var $dropdownRight = ( $window.width() ) - ( $liOffset - $left + $dropdownWidth + $dropdowntMarginLeft ); if ( $dropdownRight < 0 ) { $j( this ).css( { 'left': 'auto', 'right': - ( $window.width() - $liOffset - $liWidth - 10 ) } ); } } ); }