class Animation
package js.html
extends EventTarget
extended by CSSAnimation, CSSTransition
Available on js
The Animation
interface of the Web Animations API represents a single animation player and provides playback controls and a timeline for an animation node or source.
Documentation Animation by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Constructor
Variables
currentTime:Float
The current time value of the animation in milliseconds, whether running or paused. If the animation lacks a AnimationTimeline
, is inactive or hasn't been played yet, its value is null
.
effect:AnimationEffect
Gets and sets the AnimationEffectReadOnly
associated with this animation. This will usually be a KeyframeEffect
object.
read onlypending:Bool
Indicates whether the animation is currently waiting for an asynchronous operation such as initiating playback or pausing a running animation.
read onlyplayState:AnimationPlayState
Returns an enumerated value describing the playback state of an animation.
Methods
finish():Void
Seeks either end of an animation, depending on whether the animation is playing or reversing.
Throws:
null | DOMError |
---|
play():Void
Starts or resumes playing of an animation, or begins the animation again if it previously finished.
Throws:
null | DOMError |
---|
reverse():Void
Reverses playback direction, stopping at the start of the animation. If the animation is finished or unplayed, it will play from end to beginning.
Throws:
null | DOMError |
---|
updatePlaybackRate(playbackRate:Float):Void
Sets the speed of an animation after first synchronizing its playback position.