windows scroll condition code example
Example: windows scroll condition
window.onscroll = () =>{
// called when the window is scrolled.
if (window.scrollY >= 30) {
//your event
console.log(window.scrollY);
} else {
//your event
}
}