Animation
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.
Instance Members
id: String
Gets and sets the String
used to identify the animation.
effect: AnimationEffect
Gets and sets the AnimationEffectReadOnly
associated with this animation. This will usually be a KeyframeEffect
object.
timeline: AnimationTimeline
Gets or sets the AnimationTimeline
associated with this animation.
startTime: Float
Gets or sets the scheduled time when an animation's playback should begin.
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
.
playbackRate: Float
Gets or sets the playback rate of the animation.
playState: AnimationPlayState
Returns an enumerated value describing the playback state of an animation.
pending: Bool
Indicates whether the animation is currently waiting for an asynchronous operation such as initiating playback or pausing a running animation.
ready: js.lib.Promise<Animation>
Returns the current ready Promise for this animation.
finished: js.lib.Promise<Animation>
Returns the current finished Promise for this animation.
onfinish: haxe.Function
Gets and sets the event handler for the finish
event.
oncancel: haxe.Function
Gets and sets the event handler for the cancel
event.
cancel(): Void
Clears all KeyframeEffect
caused by this animation and aborts its playback.
finish(): Void
Seeks either end of an animation, depending on whether the animation is playing or reversing.
play(): Void
Starts or resumes playing of an animation, or begins the animation again if it previously finished.
pause(): Void
Suspends playing of an animation.
Sets the speed of an animation after first synchronizing its playback position.
Name | Type |
---|---|
playbackRate |
Float |
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.
new(?effect: AnimationEffect, ?timeline: AnimationTimeline): Void
Name | Type | Default |
---|---|---|
effect |
AnimationEffect | (optional) |
timeline |
AnimationTimeline | (optional) |