ease-animate
v1.2.0
Published
let everything ease animate
Downloads
3
Readme
ease-animate
A javascript ease animate library
Usage
install
npm install --save ease-animate
or
<script type="text/javascript" src='./dist/ease-animate.min.js'></script>
run
const animate = new Animate()
dom animate
animate.domAnimate({
selector: '#ele',
opts: {top: 200, left: 500},
duration: 1000,
onDone () {
console.log('dom done')
},
})
scrollbar animate
animate.scrollAnimate({
targetValue: 0,
duration: 1000,
onDone () {
console.log('scroll done')
},
})
API
new Animate()
domAnimate()
void domAnimate(opts) dom animation
opts:
selector
element selector
opts
css attribute and value
[duration]
default 500
[easing]
ease type, default 'quadInOut'
scrollAnimate()
void animate.scrollAnimate(opts) scrollbar animation
opts:
position
target position
[duration]
default 500, ms
[easing]
default 'circleInOut'
isScrolling
is scrolling
isDomRunning
is dom animating
easing
see ease-generator
demo
browser support
excluding ie8-