Change color of navbar link according to page position

Asked

Viewed 58 times

0

I would like to know how I do to change the color of each link of my navbar, according to the session I am on the page, if someone can tell me the name of this technique would also appreciate.

Ex:

I’m on the home page, so the border turns black, then I go down and I go to the service page, then the service link on my navbar turns black. Grateful from now on.

  • I don’t think there’s a name for this technique, just use the event onmouseover to know if you are about any Elemental and by your script to change the color in that event

  • What you want to do is called Scroll Spy, and for that you need to detect that the next session entered the screen and put an Active class for example in the menu link that corresponds to the session that entered the screen.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.