This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
The getAnimations()
method of the Document
interface returns an array of all Animation
objects currently in effect whose target elements are descendants of the document. This array includes CSS Animations, CSS Transitions, and Web Animations.
Syntax
var allAnimations = Document.getAnimations();
Parameters
None.
Return value
An Array
of Animation
objects, each representing one animation currently associated with elements which are descendants of the Document
on which it's called.
Examples
The following code snippet will slow down all animations on a page by halving their Animation.playbackRate
.
document.getAnimations().forEach(
function (animation) {
animation.playbackRate *= .5;
}
);
Specifications
Specification | Status | Comment |
---|---|---|
Web AnimationsThe definition of 'document.getAnimations()' in that specification. | Working Draft |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome Full support 84 Full support 84 Full support 83 Disabled' From version 83: this feature is behind the Notes' Implements an older version of the specification and not supported on Notes' Implements an older version of the specification, does not automatically flush pending style changes and not supported on |
Edge Full support 84 Full support 84 Full support 83 Disabled' From version 83: this feature is behind the Notes' Implements an older version of the specification and not supported on |
Firefox Full support 75 Full support 75 No support 72 — 75 Disabled' From version 72 until version 75 (exclusive): this feature is behind the Notes' Not supported on |
IE
No support No |
Opera Full support 70 Full support 70 Full support 69 Disabled' From version 69: this feature is behind the Notes' Implements an older version of the specification and not supported on Notes' Implements an older version of the specification, does not automatically flush pending style changes and not supported on |
Safari Full support 14 Full support 14 Partial support 13.1 Notes' Implements an older version of the specification and not supported on Notes' Implements an older version of the specification and not supported on |
WebView Android
Full support 84 |
Chrome Android Full support 84 Full support 84 Full support 83 Disabled' From version 83: this feature is behind the Notes' Implements an older version of the specification and not supported on Notes' Implements an older version of the specification, does not automatically flush pending style changes and not supported on |
Firefox Android Full support 79 Full support 79 Partial support 63 Notes' Not supported on |
Opera Android Full support 60 Full support 60 Partial support 48 Notes' Implements an older version of the specification and not supported on Notes' Implements an older version of the specification, does not automatically flush pending style changes and not supported on |
Safari iOS Full support 14 Full support 14 Partial support 13.4 Notes' Implements an older version of the specification and not supported on Notes' Implements an older version of the specification and not supported on |
Samsung Internet Android
No support No |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- See implementation notes.'
- See implementation notes.
- User must explicitly enable this feature.'
- User must explicitly enable this feature.
See also
- Web Animations API
- CSS Animations
- CSS Transitions
Element.getAnimations()
- Fetch only the animations on a singleElement
and its descendants.Animation
DocumentOrShadowRoot.getAnimations() by Mozilla Contributors is licensed under CC-BY-SA 2.5.