When is the current class applied to nav-links?

When is the current class applied to nav links? I am trying to apply a scroll over interaction at the same time, based on the window height the percentage seems to change. Any help would be great thanks!

The current class is applied when the link matches the link you are currently on.

For example if you have a text link called “home” and it is linked to your home page then when you are on the home page the current class will be applied.

Once you set the link and navigate to that page the current class becomes available to style.

This also applies to anchor links.

Thanks, Im wondering exactly when the current class is applied to anchor links when the section is scrolled into view. Im trying to match a Scroll Interaction when the .current class is applied to the anchor link. So far Ive found it to be somewhere between 50-60% on the scroll interaction but it’s dependent on the window height.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.