Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Latest commit

 

History

History
26 lines (20 loc) · 584 Bytes

play.md

File metadata and controls

26 lines (20 loc) · 584 Bytes

play()

This Ani instance method plays the animation. Unlike the WAAPI's play() instance method, this method returns a promise.

Syntax

// Obtain an Ani instance and call play()
ani.play();

Parameters

None

Return

  • Promise - A promise that resolves when the animation completes. The ani instance is returned on resolve.

Usage

let ani = new Ani(el, [{opacity:1}, {opacity:0}], {duration:600});
ani.play().then(ani => {
    console.log('The end!');
    // Call other methods
    ani.reverse();
});