1.0.0 • Published 11 years ago
bloody-scroll-direction v1.0.0
scroll-direction
install
$ npm install bloody-scroll-directionrequire
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
1if the scroll goes forward-1if the scroll goes backward