Skip to content
Monitor scrolling and resizing without event listeners.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
index.js
package-lock.json
package.json

README.md

srraf

Monitor scrolling and resizing without event listeners. 300 bytes gzipped.

Install

npm i srraf --save

Usage

import srraf from 'srraf'

const scroller = srraf(({ x, px, y, py, vh, pvh, vw, pvw }, timestamp) => {
  // ...
})

scroller.update() // check position
scroller.destroy() // destroy listener

Note: values prefixed with p denote previous values.

License

MIT License © Eric Bailey

You can’t perform that action at this time.