Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```