1.0.3 • Published 8 years ago

scroll-with-ease v1.0.3

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

scroll-with-ease

Scroll an element into view with animation time and cubic bezier easing functions.

Usage

var scwease = require('scroll-with-ease');
scwease(element);

Timing and easing functions

You can pass in an animation time and an array of points to create a cubic bezier curve for easing.

scwease(element, 1500, [0.42, 0.0, 0.58, 1.0])

Also accepts familiar css timing functions: ease, linear, ease-in, ease-out, ease-in-out.

scwease(element, 1500, 'ease-out')

Defaults set to 750ms and 'ease'.