(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 🙂
Auto Highlight Menu When it Reaches its Section – Elementor and GSAP Tutorial
In this tutorial, we will be making a floating bar that highlights the appropriate Menu when reaching its section. This floating bar also hides and shows when scrolling up and down. You can disable this effect if needed.
Floating Bar with Auto Highlight Menu – CSS, JS and GSAP Code
- dm-floating-nav-main is the CSS class of the main container that holds all menu items.
- dm-nav-menu is the CSS class of each container that contains your menu text. If you don’t plan on using containers for each menu item, you can simply give this CSS class to your each menu widget.
- dm-nav-container is the CSS class of sections that should trigger the highlight effect on the menu.
- To connect menu container with the right container, add the an extra CSS class to dm-nav-menu and use this same CSS class name in dm-nav-container ID. Example: “dm-nav-menu services” should be given to your menu item and then use “services” in CSS ID for the dm-nav-container that should be connected.