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: StringGets and sets the String used to identify the animation.
effect: AnimationEffectGets and sets the AnimationEffectReadOnly associated with this animation. This will usually be a KeyframeEffect object.
timeline: AnimationTimelineGets or sets the AnimationTimeline associated with this animation.
startTime: FloatGets or sets the scheduled time when an animation's playback should begin.
currentTime: FloatThe 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: FloatGets or sets the playback rate of the animation.
playState: AnimationPlayStateReturns an enumerated value describing the playback state of an animation.
pending: BoolIndicates 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.FunctionGets and sets the event handler for the finish event.
oncancel: haxe.FunctionGets and sets the event handler for the cancel event.
cancel(): VoidClears all KeyframeEffect caused by this animation and aborts its playback.
finish(): VoidSeeks either end of an animation, depending on whether the animation is playing or reversing.
play(): VoidStarts or resumes playing of an animation, or begins the animation again if it previously finished.
pause(): VoidSuspends playing of an animation.
Sets the speed of an animation after first synchronizing its playback position.
| Name | Type |
|---|---|
playbackRate |
Float |
reverse(): VoidReverses 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) |