brindille-scroll
v0.1.4
Published
Scroll utils
Downloads
9
Readme
brindille-scroll
Scroll handler that uses debounce
Install
With npm do:
$ npm install brindille-scroll --save
Usage
var scroll = require('brindille-scroll');
// add listener
scroll.addListener(handler);
// add listener without debounce
scroll.addListener(noDebounceHandler, true);
// remove listener
scroll.removeListener(handler);
scroll.removeAllListeners();
// get properties
var x = scroll.x;
var previousX = scroll.oldX;
var y = scroll.y;
var previousY = scroll.oldY;
var direction = scroll.direction
License
MIT