https://github.com/segment-boneyard/raf-scroll
requestAnimationFrame for window scroll events
https://github.com/segment-boneyard/raf-scroll
Last synced: 3 months ago
JSON representation
requestAnimationFrame for window scroll events
- Host: GitHub
- URL: https://github.com/segment-boneyard/raf-scroll
- Owner: segment-boneyard
- Created: 2014-06-19T17:35:25.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-19T17:35:30.000Z (about 11 years ago)
- Last Synced: 2025-04-13T17:13:46.481Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 105 KB
- Stars: 18
- Watchers: 40
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# raf-scroll
An emitter for binding to window scroll events that will only ever fire once per frame using `requestAnimationFrame`. Intended to replace binding to the window event directly.
```js
var scroll = require('raf-scroll');scroll.on('scroll', function log(event, position){
console.log('boo!');
});scroll.off('scroll', log);
```## Install
```
component install segmentio/raf-scroll
```