My dropdown menu has multiple submenus, and I'm facing an issue where the submenu content overlaps the container when opened. I want the container to scale to the height of the submenu content when opening, and then reduce back when closing the submenu.
https://i.sstatic.net/5IsAF.png
https://i.sstatic.net/otm3S.png
Here's the code snippet:
<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3... </script>
<style>
/* CSS styles here */
</style>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<!-- Navbar code -->
</nav>
Certain JavaScript logic was added to handle the submenu behavior:
// JavaScript logic here
If you'd like to see the complete code, you can check it out here.
I could use some assistance in refining the menu layout and functionality for a seamless user experience. Any help would be greatly appreciated!
Although I tried implementing a script to adjust the container height, I couldn't quite get it to shrink back when closing the submenu. Your guidance on this issue would be invaluable.