ScrollEmitter
enhanced scroll events like scroll: start, progress, stop, min, max
ScrollEmitter gives you custom scroll events like
scroll:startscroll:progressscroll:upscroll:downscroll:leftscroll:rightscroll:stopscroll:minscroll:max
for better event / action handling the events are triggered only in animation frames for the most performant way of default DOM manipulation.
further more it adds special propertys to the scroll state :
scrollingyscrollingxscrollingspeed xy xMax yMaxscrollingdirection xy
ScrollEmitter will only be instanciated once for the same scroll target to save memory and optimize the performance.
Dependencies
Browser support
IE >= 9, *
install
npm i --save scrollemitter
yarn add scrollemitter
Usage
var ScrollEmitter = ; // takes window as scroll targetvar scrolling = ; // orvar elementScrolling = el: document; scrolling;
demo (will be updated soon)
https://rawgit.com/soenkekluth/scrollemitter/master/demo/index.html please see the console.logs for now