I'm using this script for mousewheel. What I have tried only works one way. Instead of scroll up and down it just Scrolls forward. What I want it to do is change the cursor Forwards and Backwards. Here is what I have tried.
I've also tried the DeltaY method, But could not figure it out.
var clicked = 0;
window.addEventListener('wheel', function(event) {
if (clicked == 0) {
document.getElementsByTagName("body")[0].style.cursor = "url('https://tim-school.com/codepen/mouser/1.png'), auto";
clicked = 1;
} else if (clicked == 1) {
document.getElementsByTagName("body")[0].style.cursor = "url('https://tim-school.com/codepen/mouser/2.png'), auto";
clicked = 2;
} else if (clicked == 2) {
document.getElementsByTagName("body")[0].style.cursor = "url('https://tim-school.com/codepen/mouser/3.png'), auto";
clicked = 3;
} else if (clicked == 3) {
document.getElementsByTagName("body")[0].style.cursor = "url('https://tim-school.com/codepen/mouser/4.png'), auto";
clicked = 4;
} else if (clicked == 4) {
document.getElementsByTagName("body")[0].style.cursor = "url('https://tim-school.com/codepen/mouser/5.png'), auto";
clicked = 5;
} else if (clicked == 5) {
document.getElementsByTagName("body")[0].style.cursor = "url('https://tim-school.com/codepen/mouser/6.png'), auto";
clicked = 0;
}
});
body {
background-color: #ffffff;
overflow: hidden;
}
html,
body {
height: 100%;
}
.box {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
<div class="box"></div>