Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

scroll-to

component53.1kMIT0.0.2

Smooth window scroll to position with requestAnimationFrame

scroll, animate, scroll-to

readme

scroll-to

Smooth window scroll to position with requestAnimationFrame and Tween.

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

changelog

0.0.2 / 2015-03-19

  • docs
  • package: add "repository" field (#2)
  • package: remove "repo" field
  • package: update depdencies, fix "browserify" build
  • add browserify mappings (#6)
  • return tween instance (#4)