Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/raf-scroll
requestAnimationFrame for window scroll events
https://github.com/segment-boneyard/raf-scroll
Last synced: about 5 hours 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 (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-19T17:35:30.000Z (over 10 years ago)
- Last Synced: 2024-04-09T16:31:14.000Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 105 KB
- Stars: 18
- Watchers: 41
- 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
```