bloody-scroll-direction
v1.0.0
Published
gets scroll direction and notifies on change
Downloads
4
Readme
scroll-direction
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