Web Animations API
TheWeb 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.
In this article
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, readUsing the Web Animations API.
Web Animations interfaces
AnimationProvides playback controls and a timeline for an animation node or source. Can take an object created with the
KeyframeEffect()constructor.KeyframeEffectDescribes sets of animatable properties and values, calledkeyframes and their timing options. These can then be played using the
Animation()constructor.AnimationTimelineRepresents the timeline of animation. This interface exists to define timeline features (inherited by
DocumentTimelineand future timeline objects) and is not itself accessed by developers.AnimationEventPart of theCSS Animations module, capturing the animation name and elapsed time.
DocumentTimelineRepresents animation timelines, including the default document timeline (accessed using the
Document.timelineproperty).
Extensions to other interfaces
Extensions to theDocument interface
document.timelineThe
DocumentTimelineobject representing the default document timeline.document.getAnimations()Returns an Array of
Animationobjects currently in effect on elements in thedocument.
Extensions to theElement interface
Element.animate()A shortcut method for creating and playing an animation on an element. It returns the created
Animationobject instance.Element.getAnimations()Returns an Array of
Animationobjects currently affecting an element or which are scheduled to do so in the future.
Specifications
| Specification |
|---|
| Web Animations> |
See also
- CSS
animationshorthand property - CSS
animation-timelineproperty - Using the Web Animations API
- Using CSS animations
- CSS animations module
- CSS scroll-driven animations module