1.0.0 • Published 7 years ago

updwn v1.0.0

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

updwn

Detect up/down directional scrolling. 500 bytes gzipped.

Install

npm i updwn --save

Usage

Handlers are only fired when the scroll direction changes and the scroll speed exceeds a configurable threshold value.

import updwn from 'updwn'

const scroll = updwn({ speed: 50 })

scroll.up(() => { /* up */ })
scroll.down(() => { /* down */ })

scroll.position // => 'up' or 'down'

Handlers can be destroyed by calling the function returned at the time of their definition.

const destroy = scroll.up(() => { /* up */ })

destroy()

License

MIT License © Eric Bailey

1.0.0

7 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago