on-scroll
v1.0.0
Published
a generic, mobile-friendly scroll listener
Downloads
4
Readme
on-scroll
on-scroll is a generic, mobile-friendly scroll listener. It can be used as a basis for modules that need to track element’s scroll offsets, even on mobile devices that don’t emit scroll events during gestures.
Install
npm install on-scroll
Usage
var onscroll = require('on-scroll')
var el = document.body
var stop = onscroll(el, function (x, y) {
console.log(x, y)
=> 0 235
stop()
})