diff options
Diffstat (limited to 'files/de/web/api/window/cancelanimationframe/index.html')
-rw-r--r-- | files/de/web/api/window/cancelanimationframe/index.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/files/de/web/api/window/cancelanimationframe/index.html b/files/de/web/api/window/cancelanimationframe/index.html new file mode 100644 index 0000000000..7d38ab5be4 --- /dev/null +++ b/files/de/web/api/window/cancelanimationframe/index.html @@ -0,0 +1,72 @@ +--- +title: Window.cancelAnimationFrame() +slug: Web/API/Window/cancelAnimationFrame +tags: + - API + - Animation + - DOM + - Experimentell + - Méthode +translation_of: Web/API/Window/cancelAnimationFrame +--- +<div>{{APIRef}}{{SeeCompatTable}}</div> + +<h2 id="Summary" name="Summary">Zusammenfassung</h2> + +<p>Stopt eine vorher durch {{domxref("window.requestAnimationFrame()")}} geplante Animation.</p> + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="syntaxbox">window.cancelAnimationFrame(<em>requestID</em>); +</pre> + +<h3 id="Parameters" name="Parameters">Parameter</h3> + +<dl> + <dt><code>requestID</code></dt> + <dd>Der ID Wert der beim Aufruf von {{domxref("window.requestAnimationFrame()")}} vorher zurückgegeben wurde.</dd> +</dl> + +<h2 id="Examples" name="Examples">Beispiel</h2> + +<pre class="brush: js">var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; + +var cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame; + +var start = window.mozAnimationStartTime; // Nur unterstützt in FF. Andere Browsers können zB Date.now() benutzen. + +var myReq; + +function step(timestamp) { + var progress = timestamp - start; + d.style.left = Math.min(progress/10, 200) + "px"; + if (progress < 2000) { + myReq = requestAnimationFrame(step); + } +} +myReq = requestAnimationFrame(step); + +window.cancelAnimationFrame(myReq); +</pre> + +<h2 id="Browser_compatibility" name="Browser_compatibility">Browserkompatibilität</h2> + +<div class="hidden"> +<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> +</div> + +<p>{{Compat("api.Window.cancelAnimationFrame")}}</p> + +<h2 id="Specification" name="Specification">Spezifikation</h2> + +<ul> + <li>{{spec("http://www.w3.org/TR/animation-timing/#cancelAnimationFrame", "Timing control for script-based animations: cancelAnimationFrame", "WD")}}</li> +</ul> + +<h2 id="Siehe_auch">Siehe auch</h2> + +<ul> + <li>{{domxref("window.mozAnimationStartTime")}}</li> + <li>{{domxref("window.requestAnimationFrame()")}}</li> +</ul> |