Package Exports
- scroll
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 (scroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
scroll
A function that animates an element’s scrollTop value.
Install
npm install scroll
API
scroll.top || scroll.left (
element (element),
target (number): the desired scrollTop position,
options (object): { duration, ease },
callback (function): fn(error, position)
)
Note: The easing functions are those specified in component/ease.
Example
var scroll = require('scroll')
var element = document.body
scroll.top(element, 200, { duration: 1000 }, function(error, position) {})
scroll.left(element, 200, { ease: 'inBounce' }, function(error, position) {})