Document: getAnimations()-Methode
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.
Die getAnimations()
-Methode der Document
-Schnittstelle gibt ein Array aller aktuell wirksamen Animation
-Objekte zurück, deren Ziel-Elemente Nachkommen des Dokuments sind. Dieses Array schließt CSS-Animationen, CSS-Übergänge und Web-Animationen ein.
Syntax
getAnimations()
Parameter
Keine.
Rückgabewert
Beispiele
Das folgende Code-Snippet verlangsamt alle Animationen auf einer Seite, indem es ihre Animation.playbackRate
halbiert.
document.getAnimations().forEach((animation) => {
animation.playbackRate *= 0.5;
});
Spezifikationen
Specification |
---|
Web Animations # dom-documentorshadowroot-getanimations |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getAnimations |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
Siehe auch
- Web Animations API
- CSS-Animationen
- CSS-Übergänge
Element.getAnimations()
- Nur die Animationen auf einem einzigenElement
und dessen Nachkommen abrufen.Animation