diff options
Diffstat (limited to 'files/pt-br/web/api/animation/cancel/index.html')
-rw-r--r-- | files/pt-br/web/api/animation/cancel/index.html | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/files/pt-br/web/api/animation/cancel/index.html b/files/pt-br/web/api/animation/cancel/index.html new file mode 100644 index 0000000000..ceb1b7cf6c --- /dev/null +++ b/files/pt-br/web/api/animation/cancel/index.html @@ -0,0 +1,120 @@ +--- +title: Animation.cancel() +slug: Web/API/Animation/cancel +translation_of: Web/API/Animation/cancel +--- +<p>{{ SeeCompatTable() }}{{ APIRef("Web Animations API") }}</p> + +<p>O método <code><strong>Animation.cancel()</strong></code> da interface {{domxref("Animation")}} , limpa todas as {{domxref("KeyframeEffect", "keyframeEffects")}} geradas pela animação e aborta esta execução.</p> + +<div class="note"> +<p>Quando uma animação é cancelada, os valores de {{domxref("Animation.startTime", "startTime")}} e {{domxref("Animation.currentTime", "currentTime")}} são definidos como <code>null</code>.</p> +</div> + +<h2 id="Sintaxe">Sintaxe</h2> + +<div class="syntaxbox"> +<pre class="brush: js">// cancela animação +animation.cancel();</pre> +</div> + +<h3 id="Parametros">Parametros</h3> + +<p>Nenhum.</p> + +<h3 id="Valor_de_retorno">Valor de retorno</h3> + +<p>Nenhum.</p> + +<dl> +</dl> + +<h3 id="Exceptions">Exceptions</h3> + +<p>Se o método {{domxref("Animation.playState")}} da animação estiver executando quando a operação for cancelada, esta ação vai rejeitar a {{domxref("Animation.finished", "current finished promise")}} com a {{domxref("DOMException")}} nomeada <code>AbortError</code>.</p> + +<dl> +</dl> + +<h2 id="Especificações">Especificações</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="Compatibilidade_do_navegador">Compatibilidade do navegador</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari (WebKit)</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatGeckoDesktop(40)}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Android Webview</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>Firefox OS</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{ CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="Veja_também">Veja também</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")}} returns the promise this action will reject if the animation's <code>playState</code> is not <code>idle</code>.</li> +</ul> |