This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
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.
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.
Animation
KeyframeEffect()
constructor.KeyframeEffect
Animation()
constructor.AnimationTimeline
DocumentTimeline
and future timeline objects) and is not itself accessed by developers.DocumentTimeline
Document.timeline
property).AnimationEffectTiming
timing
attribute of a KeyframeEffect
. It inherits its properties from AnimationEffectTimingReadOnly
, but in a non-read only form.SharedKeyframeList
KeyframeEffect
objects. By using SharedKeyframeList
objects, multiple KeyframeEffect
objects can re-use the same keyframes without paying the cost of parsing them multiple times.AnimationEffectTimingProperties
Element.animate()
, KeyframeEffectReadOnly.KeyframeEffectReadOnly()
, and KeyframeEffect.KeyframeEffect()
all accept an optional dictionary object of timing properties.The Web Animations API adds some new features to document
and element
.
Document
interfacedocument.timeline
DocumentTimeline
object representing the default document timeline.document.getAnimations()
Animation
objects currently in effect on elements in the document
.Element
interfaceElement.animate()
Animation
object instance.The following interfaces are included in the spec for purposes such as defining features used in multiple other places, or to serve as bases for multiple interfaces which can all be used as values of the same properties. You wouldn't directly use these in web development work, but they may be interesting for library authors to understand how the technology works so their implementations can be more effective, or for browser engineers looking for an easier reference than the spec provides.
AnimationEffectTimingReadOnly
AnimationEffectTiming
interface associated with KeyframeEffect
.AnimationEffectReadOnly
KeyframeEffect
, which can be passed to Animation
objects for playing, and KeyframeEffectReadOnly
which is used by KeyframeEffect
(inherited by CSS Animations and Transitions). All values of Animation.effect
are of types based on AnimationEffectReadOnly
.KeyframeEffectReadOnly
Animation()
constructor, and which are inherited by KeyframeEffect
. Specification | Status | Comment |
---|---|---|
Web Animations | Working Draft | Initial definition |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support (Element.animate()) | 36.0 | 48 (48) | No support | 29 | No support |
KeyframeEffect and KeyframeEffectReadOnly clone constructors | (Yes) | No support[1] | No support | No support | No support |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | No support | 42.0 | 48.0 (48) | No support | No support | No support | 42.0 |
KeyframeEffect and KeyframeEffectReadOnly clone constructors | (Yes) | (Yes) | No support[1] | No support | No support | No support | (Yes) |
[1] Only enabled in Firefox 52 Nightly and Dev edition. Turned off in Beta/release.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API