Web Animations API

The Web Animations API allows for synchronizing and timing changes to the presentation of a Web page, i.e. animation of DOM elements. It does so by combining two models: the Timing Model and the Animation Model.

Concepts and usage

The Web Animations API provides a common language for browsers and developers to describe animations on DOM elements. To get more information on the concepts behind the API and how to use it, read Using the Web Animations API.

Web Animations interfaces

Animation

Provides playback controls and a timeline for an animation node or source. Can take an object created with the KeyframeEffect() (en-US) constructor.

KeyframeEffect (en-US)

Describes sets of animatable properties and values, called keyframes and their timing options (en-US). These can then be played using the Animation() (en-US) constructor.

AnimationTimeline (en-US)

Represents the timeline of animation. This interface exists to define timeline features (inherited by DocumentTimeline (en-US) and future timeline objects) and is not itself accessed by developers.

AnimationEvent

Actually part of CSS Animations.

DocumentTimeline (en-US)

Represents animation timelines, including the default document timeline (accessed using the Document.timeline (en-US) property).

EffectTiming (en-US)

Element.animate(), KeyframeEffectReadOnly.KeyframeEffectReadOnly() (en-US), and KeyframeEffect.KeyframeEffect() (en-US) all accept an optional dictionary object of timing properties.

Extensions to other interfaces

The Web Animations API adds some new features to document and element.

Extensions to the Document interface

document.timeline (en-US)

The DocumentTimeline object representing the default document timeline.

document.getAnimations() (en-US)

Returns an Array of Animation objects currently in effect on elements in the document.

Extensions to the Element interface

Element.animate()

A shortcut method for creating and playing an animation on an element. It returns the created Animation object instance.

Element.getAnimations() (en-US)

Returns an Array of Animation objects currently affecting an element or which are scheduled to do so in future.

Specifications

Specification Status Comment
Web Animations Rascunho atual Initial definition

See also