blob: 96c63e90a53ebb5eb0b7da9aed627dd156573ab8 (
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
72
73
74
75
|
---
title: Animation.cancel()
slug: Web/API/Animation/cancel
tags:
- API
- Animation
- Method
- Reference
- Web Animations
- cancel
- waapi
- web animations api
translation_of: Web/API/Animation/cancel
---
<p>{{ SeeCompatTable() }}{{ APIRef("Web Animations") }}</p>
<p>{{domxref("Animation")}} インターフェースにある Web Animations API の <code><strong>cancel()</strong></code> メソッドは、このアニメーションによって引き起こされたすべての {{domxref("KeyframeEffect")}}を初期化し、再生を中止します。</p>
<div class="note">
<p>アニメ―ションをキャンセルした時、{{domxref("Animation.startTime", "startTime")}} と {{domxref("Animation.currentTime", "currentTime")}} は、 <code>null</code> にセットされます。</p>
</div>
<h2 id="構文">構文</h2>
<pre class="syntaxbox notranslate"><em>Animation</em>.cancel();</pre>
<h3 id="引数">引数</h3>
<p>なし</p>
<h3 id="戻り値">戻り値</h3>
<p>なし</p>
<h3 id="例外">例外</h3>
<p>このメソッドは、直接例外をスローしません。 しかし、キャンセル時にアニメーションの{{domxref("Animation.playState", "playState")}}が <code>"idle"</code> 以外の場合、 {{domxref("Animation.finished", "current finished promise", "", 1)}} は <code>AbortError</code> という名前の {{domxref("DOMException")}} で拒否されます。</p>
<dl>
</dl>
<h2 id="仕様">仕様</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">仕様書</th>
<th scope="col">策定状況</th>
<th scope="col">備考</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="ブラウザ実装状況">ブラウザ実装状況</h2>
<div>
<p>{{Compat("api.Animation.cancel")}}</p>
</div>
<h2 id="関連情報" style="line-height: 30px; font-size: 2.14285714285714rem;">関連情報</h2>
<ul>
<li><a href="/ja/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")}} は、 <code>playState</code> <span class="tlid-translation translation" lang="ja"><span title="">が </span></span><code>"idle"</code><span class="tlid-translation translation" lang="ja"><span title=""> でない場合、</span></span> <span class="tlid-translation translation" lang="ja"><span title="">このアクションが拒否する</span></span> promise<span class="tlid-translation translation" lang="ja"><span title=""> を返します。</span></span></li>
</ul>
|