0.0.1 • Published 10 years ago
anim v0.0.1
anim
Animate a property from current to specified value, with requestAnimationFrame and easing.
example
// Fake scroll
anim(element.style, 'marginTop', -100, {
px: true,
duration: 600,
ease: 'outSine'
})
api
anim(obj, prop, to, opts, cb)
{object} obj
Container object{string} prop
Property to animate{mixed} to
Target value{object} opts
Optional options{Function} cb
Optional callback
Options are:
{integer} duration
In ms{boolean} px
Append "px" to value{boolean} round
Round value{string} ease
Easing function, e.g.outSine
orinOutQuart
install
With npm do:
npm install anim
license
MIT
credits
Adapted from scroll by Michael Rhodes (license: MIT).
0.0.1
10 years ago