Skip to main content

Methods

note

All Module methods are available in this class.

pause

Pause the timeline, halting progress without resetting it.

const tm = new Timeline();

tm.pause();

play

Play the timeline, advancing progress from the current value toward 1.

Notes:

  • If the timeline is reversed, calling play() switches it to forward mode.
  • Does nothing if the timeline is already playing or destroyed.
const tm = new Timeline();

tm.play();

reset

Reset the timeline to the beginning (progress = 0).

const tm = new Timeline();

tm.reset();

reverse

Reverse the timeline, moving progress from the current value toward 0.

Notes:

  • If the timeline is playing forward, calling reverse() switches direction.
  • Does nothing if progress is already 0 or the instance is destroyed.
const tm = new Timeline();

tm.reverse();

destroy

Destroys the instance and cleans up resources.

const tm = new Timeline();

tm.destroy();