forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split DocumentOrShadowRoot/getAnimations mixin page under real interf…
…ace pages (mdn#3029) * Move page and update links * Add docs for ShadowRoot.getAnimations
- Loading branch information
Showing
10 changed files
with
129 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
title: ShadowRoot.getAnimations() | ||
slug: Web/API/ShadowRoot/getAnimations | ||
tags: | ||
- API | ||
- Animation | ||
- CSS | ||
- CSS Animations | ||
- CSS Transitions | ||
- ShadowRoot | ||
- Method | ||
- Reference | ||
- Transitions | ||
- Web Animations | ||
- getAnimations | ||
- waapi | ||
- web animations api | ||
--- | ||
<p>{{APIRef("Web Animations")}}</p> | ||
|
||
<p>The <code>getAnimations()</code> method of the {{domxref("ShadowRoot")}} interface | ||
returns an array of all {{domxref("Animation")}} objects currently in effect whose | ||
target elements are descendants of the shadow tree. This array includes <a | ||
href="/en-US/docs/Web/CSS/CSS_Animations">CSS Animations</a>, <a | ||
href="/en-US/docs/Web/CSS/CSS_Transitions">CSS Transitions</a>, and <a | ||
href="/en-US/docs/Web/API/Web_Animations_API">Web Animations</a>.</p> | ||
|
||
<h2 id="Syntax">Syntax</h2> | ||
|
||
<pre class="brush: js">getAnimations();</pre> | ||
|
||
<h3 id="Parameters">Parameters</h3> | ||
|
||
<p>None.</p> | ||
|
||
<h3 id="Return_value">Return value</h3> | ||
|
||
<p>An {{jsxref("Array")}} of {{domxref("Animation")}} objects, each representing one | ||
animation currently associated with elements which are descendants of the | ||
{{domxref("ShadowRoot")}} on which it's called.</p> | ||
|
||
<h2 id="Examples">Examples</h2> | ||
|
||
<p>The following code snippet will slow down all animations in a shadow tree by halving their | ||
{{domxref("Animation.playbackRate")}}.</p> | ||
|
||
<pre class="brush: js"> | ||
let customElem = document.querySelector('my-shadow-dom-element'); | ||
let shadow = customElem.shadowRoot; | ||
shadow.getAnimations().forEach( | ||
function (animation) { | ||
animation.playbackRate *= .5; | ||
} | ||
);</pre> | ||
|
||
<h2 id="Specifications">Specifications</h2> | ||
|
||
<table class="standard-table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Specification</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>{{SpecName('Web Animations', '#dom-documentorshadowroot-getanimations', 'DocumentOrShadowRoot.getAnimations()' )}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2 id="Browser_compatibility">Browser compatibility</h2> | ||
|
||
<p>{{Compat("api.ShadowRoot.getAnimations")}}</p> | ||
|
||
<h2 id="See_also">See also</h2> | ||
|
||
<ul> | ||
<li><a href="/en-US/docs/Web/API/Web_Animations_API">Web Animations API</a></li> | ||
<li><a href="/en-US/docs/Web/CSS/CSS_Animations">CSS Animations</a></li> | ||
<li><a href="/en-US/docs/Web/CSS/CSS_Transitions">CSS Transitions</a></li> | ||
<li>{{domxref("Element.getAnimations()")}} - Fetch only the animations on a single | ||
{{domxref("Element")}} and its descendants.</li> | ||
<li>{{domxref("Animation")}}</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters