I need to do something like this -> If the scroll goes below 200px, change the page colour to red. If it is over 200px, change it to white. How can I achieve this?
const event11 = window.addEventListener('wheel', function(e) {
console.log(e);
console.log(window.innerHeight);
if(e.pageY < (window.innerHeight - 200)) {
document.body.style.backgroundColor = "red";
} else {
document.body.style.backgroundColor = "white";
}
});