scroll-with-ease

1.0.3 • Public • Published

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'.

Package Sidebar

Install

npm i scroll-with-ease

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • mattlarner