(This page includes affiliate links. If you click and purchase, I receive a small commission at no extra cost from you and that way you can support me. I only recommend tools that I have personally used and loved.)
Get Elementor Pro Today –
1 – Elementor Pro
Don’t want to make from scratch? Buy the template instead 🙂
Introduction – Floating Animated Modern Menu with Elementor & GSAP
In this tutorial, we are creating a floating bar that collapses and extends when clicked on hamburger icon. We also have a submenu box that automatically follows the menu links when hovered. The submenu links are switches to appropriate ones while the background box follows the hovered menu link.
Reminder: The floating bar is not responsive for mobile/tablet devices due to its nature. So make sure to hide it for mobile/tablet devices via the responsive settings available in Elementor page builder.
Floating Bar Animated Menu – Elementor and GSAP
- dm-menu-container-4 is the CSS class of the Menu container that contains the logo, links and hamburger menu.
- min(98%, 800px); is the width given to the menu container that contains all.
- dm-menu-list-container-4 is the CSS class of the container that contains the page links. (The middle container between logo and hamburger icon).
- dm-menu-icon-4 is the CSS class of the hamburger menu icon that opens/closes the menu bar.
- To change the width of the middle container ( page links container), change the CSS code in dm-menu-list-container-4. Change both width & max-width to your desired value.
- For the collapsed menu bar size, change the width:150 to your desired final width size.
- dm-submenu-list is the extra CSS class given to menu page links that should show submenus. The CSS class of the submenu page link should look like “dm-menu-list-4 dm-submenu-list“.
Add Submenu to the floating bar – Elementor & GSAP
- dm-submenu-4 is the CSS class of the main container that contains all submenu child container.
- dm-submenu-list is the extra CSS class given to menu page links that should show submenus. The CSS class of the submenu page link should look like “dm-menu-list-4 dm-submenu-list“.
- dm-submenu-4-content is the CSS class of containers that have submenu page links/contents. (These are given to child containers of the parent container dm-submenu-4)
- The order of submenu content containers and menu page links should be same. Else the submenu will not show in the right page link.