TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juliangarnier/anime/llms.txt
Use this file to discover all available pages before exploring further.
Timeline class is the core class for creating complex animation sequences in Anime.js. It extends the Timer class and provides methods to add, synchronize, and control multiple animations along a shared timeline.
Constructor
Timeline(parameters?)
Creates a new Timeline instance.Optional configuration object for the timeline
Properties
id
Unique identifier for the timeline instance.
duration
Total duration of the timeline in milliseconds, including all loops. This value automatically updates as children are added.
iterationDuration
Duration of a single iteration (loop) of the timeline in milliseconds.
labels
Object containing named position labels. Used for positioning animations at specific named points in the timeline.
defaults
Default parameters inherited by all child animations added to the timeline.
composition
Indicates whether the timeline automatically composes animations as they’re added.
onRender
Callback function invoked when the timeline renders.
Inherited Properties
The Timeline class inherits all properties from the Timer class, including:currentTime- Current playback position in millisecondsprogress- Current playback progress (0-1)iterationCurrentTime- Current time within the current iterationiterationProgress- Progress within the current iteration (0-1)currentIteration- Current loop iteration indexpaused- Whether the timeline is pausedbegan- Whether the timeline has begun playingcompleted- Whether the timeline has completedcancelled- Whether the timeline has been cancelledreversed- Whether the timeline is playing in reversespeed- Playback speed multiplieriterationCount- Total number of iterations
Factory Function
createTimeline(parameters?)
Convenience factory function that creates and initializes a Timeline instance.Optional timeline configuration parameters.
An initialized Timeline instance ready to play.
See Also
- Timeline Methods - Methods for controlling and manipulating the timeline
- Timeline Parameters - Detailed parameter reference
- Timer Class - Base class that Timeline extends