This Ani instance method plays the animation. Unlike the WAAPI's play()
instance method, this method returns a promise.
// Obtain an Ani instance and call play()
ani.play();
None
Promise
- A promise that resolves when the animation completes. Theani
instance is returned on resolve.
let ani = new Ani(el, [{opacity:1}, {opacity:0}], {duration:600});
ani.play().then(ani => {
console.log('The end!');
// Call other methods
ani.reverse();
});