I’m making a scroll detector for a website and I need to make it work for mobile. So, if a desktop user scrolled down with their mouse, it’d console log it, and vice versa. Here is the desktop code for you to analyze:
window.addEventListener("wheel", function (event) {
event.preventDefault();
if (event.deltaY < 0) {
console.log('up')
} else {
console.log('down')
}
}
});
How would I do this for mobile devices such as phones or tablets?