So I have a header and I want to change the colors of the links in the header when I start scrolling. The nav in the header is in a list:
<nav class="top-nav">
<ul class="top-nav">
<li><a href="#home" class="scroll">Home</a></li>
<li><a href="#services" class="scroll">Services</a></li>
<li><a href="#port" class="scroll">Portfolio</a></li>
<li><a href="#team" class="scroll">Team</a></li>
<li><a href="#contact" class="scroll">Contact</a></li>
</ul>
</nav>
To change the header I use this code:
$(window).scroll(function(){
if ($(window).scrollTop() >= 100) {
$('.header').addClass('fixed');
$(".top-nav").css("color", "grey");
$(".logo").css("color", "grey");
}
else {
$('.header').removeClass('fixed');
$("top-nav").css("color", "white");
$(".logo").css("color", "white");
}
});
The color of the logo text changes fine, and the fixed header applies fine, so the code works, I just don't know how to specify that the links in the top-nav should be changed.