0.0.1 • Published 11 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} objContainer object{string} propProperty to animate{mixed} toTarget value{object} optsOptional options{Function} cbOptional callback
Options are:
{integer} durationIn ms{boolean} pxAppend "px" to value{boolean} roundRound value{string} easeEasing function, e.g.outSineorinOutQuart
install
With npm do:
npm install animlicense
MIT
credits
Adapted from scroll by Michael Rhodes (license: MIT).
0.0.1
11 years ago