It's been a REALLY long time since I've been on here but I need some help. After about an hour or two of searching around for the solution all I get is broken scripts trying to merge two separate scripts together.

I have a simple one-page portfolio site I needed to make for myself, and I have a sticky header that will scroll down to four sections. Each section is color coded, and if I scroll to the section I want to add an 'selected' class to the nav item, but I also want to add a class to change the logo color to match the specific section your in.

Any help would be super appreciated since I've already wasted so much time trying to hack something together.

Essentially when someone clicks a specific nav item I want to add selected and then switch a class in another link.

A good way to do that is to setup a click event on a parent element of those links (such as #nav) so that when one of the links is clicked, you can loop through and remove selected from all of those links, then add it just to the one that was clicked on.

A good way to do that is to setup a click event on a parent element of those links (such as #nav) so that when one of the links is clicked, you can loop through and remove selected from all of those links, then add it just to the one that was clicked on.

Thanks Paul, I've got that under control. My problem is triggering a second even to add a specific class to another <a> that will change the color of my logo my moving a background image.

I have a buddy who knows Javascript better than I do and hopefully he can take a peak for me.