This Ani instance method returns the animation's percentage progress as a number.
// Obtain an Ani instance and call progress()
let progress = ani.progress();
None
Number
: A number between0
and1
, representing 0% and 100% respectively, of the animation's total timing. Here the total timing is calculated asdelay + duration + endDelay
.
let ani = new Ani(el, [{opacity:1}, {opacity:0}], {delay: 100, duration:600});
// Get the progress at 350ms
setTimeout(() => {
console.log(ani.progress()); // About 0.5
}, 350);