I'm currently working on implementing a Nested Navbar Dropdown (Submenu, Multilevel, and Mega Menu). However, I am encountering some challenges related to sizing with max-width
and min-width
, as well as handling directions with dropstart
and dropend
based on the page viewport.
Here is a snippet of my code:
HTML
<nav id="navbar-area" class="navbar navbar-expand-lg navbar-light bg-light py-4">
<!-- Code snippet omitted for brevity -->
</nav>
CSS:
#navbar-area .navbar-collapse .navbar-nav .nav-item.dropdown .dropdown-menu {
/* CSS rules omitted for brevity */
}
/* More CSS rules omitted */
@media screen and (min-width: 992px) {
/* Media query CSS rules omitted */
}
JavaScript:
$(".dropdown-menu [data-bs-toggle='dropdown']").on("click", function (event) {
// JavaScript functionality omitted for brevity
});
Live Example: