You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Readme.md 589 B

3 years ago
123456789101112131415161718192021222324252627282930
  1. # scroll-to
  2. Smooth window scroll to position with requestAnimationFrame and [Tween](https://github.com/component/tween).
  3. ## Installation
  4. $ component install component/scroll-to
  5. ## API
  6. ### scrollTo(x, y, [options])
  7. Scroll to the given point `(x, y)` with the given `options`:
  8. - `ease` easing function defaulting to "out-circ" (view [ease](https://github.com/component/ease) for more)
  9. - `duration` animation duration defaulting to `1000`
  10. ```js
  11. var scrollTo = require('scroll-to');
  12. scrollTo(500, 1200, {
  13. ease: 'out-bounce',
  14. duration: 1500
  15. });
  16. ```
  17. ## License
  18. MIT