1.0.0 • Published 10 years ago

bloody-scroll-direction v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

scroll-direction

browser support

install

$ npm install bloody-scroll-direction

require

var scrollDir = require("bloody-scroll-direction")

api

scrollDir.create() > s

creates a scrollDir instance and starts listening to the scroll event.

scrollDir.destroy()

stops listening to the scroll event.

scrollDir.on("change", callback)

let callback be notified when the scroll direction changes.

a data object is passed to callback, containing to properties :

offset

scroll value

direction

  • 1 if the scroll goes forward
  • -1 if the scroll goes backward
1.0.0

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago