1// call the preventDefault() method on the event
2function preventScrollWheel(event) {
3 if (typeof event.cancelable !== 'boolean' || event.cancelable) {
4 event.preventDefault();
5 } else {
6 // to call preventDefault() on it.
7 console.warn(`The following event couldn't be canceled:`);
8 console.dir(event);
9 }
10}
11
12document.addEventListener('wheel', preventScrollWheel);