Mega menü ile ilgili bir çalışma yaptırdım fakat menü üzerine geldiğinde menüye göre kayma yapıyor.
let eduVibeMegaMenu = function() {
if ( "rtl" == document.dir ) {
$( '.main-navigation ul > li.mega-menu' ).each(function() {
let items = $(this).find( ' > ul.eduvibe-dropdown-menu > li' ).length,
bodyWidth = $( 'body' ).outerWidth(),
parentLinkWidth = $(this).find( ' > a' ).outerWidth(),
parentLinkpos = $(this).find( ' > a' ).offset().left,
width = 1100,
left = width / 2 - 500 - parentLinkWidth / 2,
linkleftWidth = parentLinkpos + parentLinkWidth / 2,
linkRightWidth = bodyWidth - (parentLinkpos + parentLinkWidth);
if (width / 2 > linkleftWidth) {
$(this).find( ' > ul.eduvibe-dropdown-menu' ).css( {
width: width + 'px',
right: 'inherit',
left: '-' + parentLinkpos + 'px'
} );
} else if (width / 2 > linkRightWidth) {
$(this).find( ' > ul.eduvibe-dropdown-menu' ).css( {
width: width + 'px',
left: 'inherit',
right: '-' + linkRightWidth + 'px'
} );
} else {
$(this).find( ' > ul.eduvibe-dropdown-menu' ).css( {
width: width + 'px',
right: '-' + left + 'px'
} );
}
} );
} else {
$( '.main-navigation ul > li.mega-menu' ).each(function() {
let items = $(this).find( ' > ul.eduvibe-dropdown-menu > li' ).length,
bodyWidth = $( 'body' ).outerWidth(),
parentLinkWidth = $(this).find( ' > a' ).outerWidth(),
parentLinkpos = $(this).find( ' > a' ).offset().left,
width = 1100,
left = width / 2 - 100 - parentLinkWidth / 2,
linkleftWidth = parentLinkpos + parentLinkWidth / 2,
linkRightWidth = bodyWidth - (parentLinkpos + parentLinkWidth);
if (width / 2 > linkleftWidth) {
$(this).find( ' > ul.eduvibe-dropdown-menu' ).css( {
width: width + 'px',
right: 'inherit',
left: '-' + parentLinkpos + 'px'
} );
} else if (width / 2 > linkRightWidth) {
$(this).find( ' > ul.eduvibe-dropdown-menu' ).css( {
width: width + 'px',
left: 'inherit',
right: '-' + linkRightWidth + 'px'
} );
} else {
$(this).find( ' > ul.eduvibe-dropdown-menu' ).css( {
width: width + 'px',
left: '-' + left + 'px'
} );
}
} );
}
}Site adresi : HesaplamaÜcretli destek istediğim konu ise ben mega menümün sabit şekilde açılmasını istiyorum..
Örnek Site : Hesaplama
Eğer ki bunu çözecek arkadaş olursa bana ulaşırsa çok sevinirim.