scroll-event
v1.1.0
Published
Scroll event handler for value-event
Downloads
8
Maintainers
Readme
scroll-event
Scroll event handler for value-event
Install
$ npm install --save scroll-event
Usage
var scrollEvent = require('scroll-event')
var h = require('virtual-dom/h')
h('div', {
'ev-scroll': scrollEvent(scrollHandler)
})
API
scrollEvent(handler, [data])
-> function
handler
Required
Type: function
The handler to call when the element is scrolled.
data
Type: object
Default: {}
Data to pass to the handler when the element is scrolled. This will include x/y coordinates for the scroll position, the maximum scrollable distance ({maximum: {x, y}}
), as well as custom properties you define.
License
MIT © Ben Drucker