Add responsive dropdown menu behavior and style adjustments

This commit is contained in:
Roman Pyrih
2025-04-01 09:47:33 +02:00
parent da5caf6201
commit b483d5eb61
4 changed files with 40 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5639,3 +5639,19 @@ body {
.zoomContainer {
border: none !important;
}
.leo-top-menu {
ul.navbar-nav.megamenu {
> li.nav-item {
// &.dropdown {
&:nth-last-child(2) {
.dropdown-menu.level1 {
ul {
grid-template-columns: repeat(3, 270px);
}
}
}
// }
}
}
}

View File

@@ -1050,4 +1050,25 @@ $(document).ready(function(){
$(headerNav).removeClass('fixed');
}
})
})
})
$(document).ready(function () {
$('.nav-item.parent.dropdown').on('mouseenter', function () {
var $submenu = $(this).find('.dropdown-menu');
if ($submenu.length) {
$submenu.css({ left: '', right: '', transform: '' });
var submenuRect = $submenu[0].getBoundingClientRect();
var windowWidth = $(window).width();
if (submenuRect.right > windowWidth) {
$submenu.attr('style', 'left: 50% !important; right: auto !important; transform: translateX(-50%) !important;');
} else if (submenuRect.left < 0) {
$submenu.attr('style', 'left: 50% !important; right: auto !important; transform: translateX(-50%) !important;');
} else {
$submenu.css({ left: '', right: '', transform: '' });
}
}
});
});