0.0.10 • Published 8 years ago

raf-scroll.js v0.0.10

Weekly downloads
576
License
MIT
Repository
github
Last release
8 years ago

A simple, performance optimized replacement for window.addEventListener('scroll', function(e) {...

The premiss for this module is to utilize animation frames to trigger scroll callbacks in the appropriate render pipeline location of each frame.

Install

npm i raf-scroll.js --save

Usage

import scroll from 'raf-scroll.js'

scroll( (y, prevY) => {
}

The callback passed to the scroll function will get passed the current scrollY value (param 1) and the previous scrollY value (param 2). From this you will be able to ascertain scroll direction.

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago