scroll-to

Smooth window scroll to position with requestAnimationFrame

npm install scroll-to
4 downloads in the last week
7 downloads in the last month

scroll-to

Smooth window scroll to position with requestAnimationFrame

Installation

$ component install component/scroll-to

API

scrollTo(x, y, [options])

Scroll to the given point (x, y) with the given options:

  • ease easing function defaulting to "out-circ" (view ease for more)
  • duration animation duration defaulting to 1000
var scrollTo = require('scroll-to');

scrollTo(500, 1200, {
  ease: 'out-bounce',
  duration: 1500
});

License

MIT

npm loves you