| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/getAnimations | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since September 2020.
The getAnimations() method of the ShadowRoot interface
returns an array of all Animation objects currently in effect whose
target elements are descendants of the shadow tree. This array includes CSS Animations, CSS Transitions, and Web Animations.
getAnimations()
None.
An Array of Animation objects, each representing one
animation currently associated with elements which are descendants of the
ShadowRoot on which it's called.
The following code snippet will slow down all animations in a shadow tree by halving their
Animation.playbackRate.
let customElem = document.querySelector("my-shadow-dom-element");
let shadow = customElem.shadowRoot;
shadow.getAnimations().forEach((animation) => {
animation.playbackRate *= 0.5;
});
| Specification |
|---|
| Web Animations # dom-documentorshadowroot-getanimations |
Element.getAnimations() - Fetch only the animations on a single
Element and its descendants.AnimationThis page was last modified on Nov 7, 2025 by MDN contributors.
ShadowRootYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |