Get the scroll speed being used on either the window or a particular element.
Listens to element
for scroll events. If you don't supply an element, this
will default to window
. Pass preventDefault
as true
to override the
default scrolling behavior.
Calls callback
whenever a scroll event is captured, passing a normalized
wheel
event for you to read from.
You need to call at the end of each frame for the module to work properly – we
need to cater to the possibility of multiple events per frame. Stick this at
the end of your requestAnimationFrame
or setInterval
loop.
The horizontal speed of the scroll.
The vertical speed of the scroll.
The depth speed of the scroll – you never know!
MIT. See LICENSE.md for details.