steer
Script that fires events only when the user changes the scrolling direction.
Install
Include the distribution file in your project
also available on bower
bower install steer --save
... and npm as steerjs
npm install steerjs --save
steer.set()
This method set
lets you configure the actions to be called everytime the user changes the scroll direction.
steer;
In case you need it, the y position when the function was fired is passed as an argument.
steer;
steer.trigger()
You can pass a flag called events
with the value false
in the configuration object so no listeners are added on scroll.
steer;
Then for steer to work you need to call steer.trigger()
in the scroll event in your code.
window;
Size
steer is really light, 307 bytes minified and gzipped!
Browser support
This library works perfect in the latest version of all modern browsers and Internet Explorer 9+, and requires requestAnimationFrame
and addEventListener
support.
Contribute
Feel free to rise an issue or suggest a change that you think that can improve this code.