aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/animation/cancel/index.html
blob: bc2c02c2809a95fb7ab7b37de90be0abde3b3200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: Animation.cancel()
slug: Web/API/Animation/cancel
tags:
  - API
  - Animacion
  - Animaciones Web
  - Experimental
  - Reference
  - cancel
  - metodo
  - waapi
translation_of: Web/API/Animation/cancel
---
<p>{{ SeeCompatTable() }}{{ APIRef("Web Animations") }}</p>

<p>El método <code><strong>cancel()</strong></code> de la Web Animations API de la interfaz {{domxref("Animation")}} borra todos los {{domxref("KeyframeEffect")}} causados por esta animación y aborta su reproducción.</p>

<div class="note">
<p>Cuando se cancela una animación, su {{domxref("Animation.startTime", "startTime")}} y su {{domxref("Animation.currentTime", "currentTime")}} se establecen en  <code>null</code>.</p>
</div>

<h2 id="Sintaxis">Sintaxis</h2>

<pre class="syntaxbox"><em>Animation</em>.cancel();</pre>

<h3 id="Parámetros">Parámetros</h3>

<p>None.</p>

<h3 id="Valor_devuelto">Valor devuelto</h3>

<p>None.</p>

<h3 id="Excepciones">Excepciones</h3>

<p>Este método no arroja excepciones directamente; sin embargo, si la animación {{domxref ("Animation.playState", "playState")}} no está <code>"idle"</code>"inactiva" cuando se cancela, el {{domxref ("Animation.finished", "current finished promise", "", 1)}} se rechaza con un {{domxref ("DOMException")}} llamado <code>AbortError</code>.</p>

<dl>
</dl>

<h2 id="Especificaciones">Especificaciones</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Web Animations', '#dom-animation-cancel', 'Animation.cancel()' )}}</td>
   <td>{{Spec2('Web Animations')}}</td>
   <td>Editor's draft.</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_del_navegador">Compatibilidad del navegador</h2>

{{Compat("api.Animation.cancel")}}

<h2 id="Ver_también" style="line-height: 30px; font-size: 2.14285714285714rem;">Ver también</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Web_Animations_API">Web Animations API</a></li>
 <li>{{domxref("KeyframeEffect")}}</li>
 <li>{{domxref("Animation")}}</li>
 <li>{{domxref("Animation.playState")}}</li>
 <li>{{domxref("Animation.finished")}} devuelve la promesa que esta acción rechazará si la animación de <code>playState</code> no está <code>"idle"</code> ("inactiva") .</li>
</ul>