Package Exports
- animate-overflow-scroll-to
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (animate-overflow-scroll-to) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
animate-overflow-scroll-to
Smooth element / window scroll to position with requestAnimationFrame and Tween.
Fork notice
This is a fork of scroll-to
This fork expands the API by enabling animated / smooth scrolling for any element that has scrollTop / scrollLeft and overflow: scroll enabled.
Installation
$ npm i animate-overflow-scroll
API
scrollTo(domNode, x, y, [options])
Scroll a domNode to the given point x, y with the given options:
easeeasing function defaulting to "out-circ" (view ease for more)durationanimation duration defaulting to1000
var scrollTo = require('animate-overflow-scroll-to');
// scrollDiv should have overflow: scroll set in its style
var scrollDiv = document.getElementById('scrollDiv')
scrollTo(scrollDiv, 500, 1200, {
ease: 'out-bounce',
duration: 1500
});Example
To run the example.html file, you need to install component to build the bundle.
component is outdated, but PRs are welcomed to switch the build to something else like browserify or webpack.
$ npm i
$ npm install -g component
$ component buildLicense
MIT