animate-scroll-to.js
v0.1.5
Published
Simple plugin for scroll smoothly.
Downloads
8
Readme
animate-scroll-to
Simple plugin for scroll smoothly.
Installation and use
install with npm
npm install animate-scroll-to.jsCommon.js
var animateScrollTo = require('animate-scroll-to.js');or add it to your page
<script src="dist/animate-scroll-to.js"></script>
<!-- or minified version -->
<script src="dist/animate-scroll-to.min.js"></script>API
var scroller = animateScrollTo(target[, options][, callback]);target
- a number with vertical offset in px
50. - a string with relative step:
+=50,-=50. - a string with shorthand
top | bottom.
options
duration: Number- duration of the animation(default: 468).animate: Boolean- whether the scrolling should animate smoothly(default: true).speed: Number- px per second (px/s) of animation.
NOTE: if speed specifies duration will be ignored.
scroller
startpauseresumeisPaused
TODO
- [] autoStart
- [] change speed
License
MIT
