CSSAnimation

The CSSAnimation interface of the Web Animations API represents an Animation object.

MDN Reference

Properties

Link copied to clipboard

The animationName property of the specifies one or more keyframe at-rules which describe the animation applied to the element.

Link copied to clipboard

The Animation.currentTime property of the Web Animations API returns and sets the current time value of the animation in milliseconds, whether running or paused.

Link copied to clipboard

The Animation.effect property of the Web Animations API gets and sets the target effect of an animation.

Link copied to clipboard

The Animation.finished read-only property of the Web Animations API returns a Promise which resolves once the animation has finished playing.

Link copied to clipboard
var id: String

The Animation.id property of the Web Animations API returns or sets a string used to identify the animation.

Link copied to clipboard

The read-only Animation.pending property of the Web Animations API indicates whether the animation is currently waiting for an asynchronous operation such as initiating playback or pausing a running animation.

Link copied to clipboard

The Animation.playbackRate property of the Web Animations API returns or sets the playback rate of the animation.

Link copied to clipboard

The read-only Animation.playState property of the Web Animations API returns an enumerated value describing the playback state of an animation.

Link copied to clipboard

The read-only Animation.ready property of the Web Animations API returns a Promise which resolves when the animation is ready to play.

Link copied to clipboard

The read-only Animation.replaceState property of the Web Animations API indicates whether the animation has been removed by the browser automatically after being replaced by another animation.

Link copied to clipboard

The Animation.startTime property of the Animation interface is a double-precision floating-point value which indicates the scheduled time when an animation's playback should begin.

Link copied to clipboard

The Animation.timeline property of the Animation interface returns or sets the AnimationTimeline associated with this animation.

Functions

Link copied to clipboard
fun cancel()

The Web Animations API's cancel() method of the Animation interface clears all KeyframeEffects caused by this animation and aborts its playback.

Link copied to clipboard

The commitStyles() method of the Web Animations API's Animation interface writes the computed values of the animation's current styles into its target element's style attribute.

Link copied to clipboard
Link copied to clipboard
fun finish()

The finish() method of the Web Animations API's Animation Interface sets the current playback time to the end of the animation corresponding to the current playback direction.

Link copied to clipboard
fun pause()

The pause() method of the Web Animations API's Animation interface suspends playback of the animation.

Link copied to clipboard
fun persist()

The persist() method of the Web Animations API's Animation interface explicitly persists an animation, preventing it from being automatically removed when it is replaced by another animation.

Link copied to clipboard
fun play()

The play() method of the Web Animations API's Animation Interface starts or resumes playing of an animation.

Link copied to clipboard
fun reverse()

The Animation.reverse() method of the Animation Interface reverses the playback direction, meaning the animation ends at its beginning.

Link copied to clipboard
fun updatePlaybackRate(playbackRate: Double)

The updatePlaybackRate() method of the Web Animations API's synchronizing its playback position.

Link copied to clipboard