Animation
Module: JavaScript DOM API
The Animation object for dom element.
#include <Animation.idl>
Inherited by CSSAnimation
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| void | play() Starts playing the animation if paused, does nothing if already running. |
| void | pause() Pauses the animation if running, does nothing if finished/paused. |
| void | reverse() Reverses the animations playbackRate and plays it. |
| void | playFromTo(double playTime, double pauseTime, optional AnyCallback callback) Plays an animation from the selected time to the pause time. When the pauseTime is reached, the animation is automatically paused and the callback is invoked. |
| void | commitStyles() |
| void | finish() |
| void | cancel() |
| void | persist() |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| attribute double | currentTime The current time of the animation. |
| attribute double | playbackRate The playback rate of the animation. |
| attribute EventSetter | finish |
Public Functions Documentation
Section titled “Public Functions Documentation”function play
Section titled “function play”void play()Starts playing the animation if paused, does nothing if already running.
function pause
Section titled “function pause”void pause()Pauses the animation if running, does nothing if finished/paused.
function reverse
Section titled “function reverse”void reverse()Reverses the animations playbackRate and plays it.
function playFromTo
Section titled “function playFromTo”void playFromTo( double playTime, double pauseTime, optional AnyCallback callback)Plays an animation from the selected time to the pause time. When the pauseTime is reached, the animation is automatically paused and the callback is invoked.
function commitStyles
Section titled “function commitStyles”void commitStyles()function finish
Section titled “function finish”void finish()function cancel
Section titled “function cancel”void cancel()function persist
Section titled “function persist”void persist()Public Attributes Documentation
Section titled “Public Attributes Documentation”variable currentTime
Section titled “variable currentTime”attribute double currentTime;The current time of the animation.
variable playbackRate
Section titled “variable playbackRate”attribute double playbackRate;The playback rate of the animation.
variable finish
Section titled “variable finish”attribute EventSetter finish;© 2026 Coherent Labs. All rights reserved.