I use this code to change the color of id="logo"
from white to green. But I want to change the color back to white when I have scrolled all the way down to the bottom of the site.
I have tried with else if but haven't got the else if function to work..
const nav = document.querySelector('#logo');
nav.className = 'blend'
window.onscroll = () => {
if(this.scrollY >= window.innerHeight-80) nav.className = 'color';
else nav.className = 'blend';
};
.blend a{
color: white;
}
.color a{
color: green;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="logo" class="nav color">
<a>LOGO</a>
</div>