So when I scroll down below 100px I want the menu to become transparent but when you scroll back to the top it goes back to solid color.
Example of my menu:
<div id="menu" class="transparent">
<menu tags etc>
</div>
CSS
#menu {
background-color: black
}
.transparent {
opacity: 0.5
transition: all 0.5s
}
How can I do this using JavaScript? Not sure if I got this wrong already because my menu is already transparent due to the class transparent.