1.0.0 • Published 7 years ago

on-scroll v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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