npm.io
1.0.0 • Published 9 years ago

on-scroll

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
1

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()
})
License

MIT

Keywords