Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/scroll-to
Smooth window scrolling with requestAnimationFrame and the Tween component
https://github.com/component/scroll-to
Last synced: 3 days ago
JSON representation
Smooth window scrolling with requestAnimationFrame and the Tween component
- Host: GitHub
- URL: https://github.com/component/scroll-to
- Owner: component
- Created: 2013-05-28T15:27:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T08:39:56.000Z (over 7 years ago)
- Last Synced: 2024-04-14T06:52:40.609Z (9 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 88
- Watchers: 8
- Forks: 38
- Open Issues: 10
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# scroll-to
Smooth window scroll to position with requestAnimationFrame and [Tween](https://github.com/component/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](https://github.com/component/ease) for more)
- `duration` animation duration defaulting to `1000````js
var scrollTo = require('scroll-to');scrollTo(500, 1200, {
ease: 'out-bounce',
duration: 1500
});
```## License
MIT