I'm trying to listen to the scroll wheel event to get the "expected number of pixels scrolled" in a deltaX and deltaY value, and this across browser. I am surprised about how few documentation and libraries there is to make this. (only the Mozilla MDN even talks about the "wheel" event).
I found two scripts supposed to make this work across browser but I can't make any of those operate properly.
https://developer.mozilla.org/fr/docs/Web/Events/wheel
On this page "Listening to this event across browser" section provides a script supposed to solves this issue.
I get this error
wheel.js:30 Uncaught TypeError: elem[_addEventListener] is not a function.
and also
https://github.com/anvaka/wheel/blob/master/index.js
With this one, just as the other one I get errors too :
wheel.js:17 Uncaught ReferenceError: module is not defined
index.js:144 Uncaught ReferenceError: require is not defined
Can someone manages to make it work or have another solution ?