From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/window/cancelanimationframe/index.html | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 files/ja/web/api/window/cancelanimationframe/index.html (limited to 'files/ja/web/api/window/cancelanimationframe/index.html') diff --git a/files/ja/web/api/window/cancelanimationframe/index.html b/files/ja/web/api/window/cancelanimationframe/index.html new file mode 100644 index 0000000000..98bea1681c --- /dev/null +++ b/files/ja/web/api/window/cancelanimationframe/index.html @@ -0,0 +1,122 @@ +--- +title: window.cancelAnimationFrame +slug: Web/API/Window/cancelAnimationFrame +tags: + - API + - DOM + - Method +translation_of: Web/API/Window/cancelAnimationFrame +--- +
{{APIRef}}
+ +

概要

+ +

{{domxref("window.requestAnimationFrame()")}} の呼び出しによりスケジュールされたフレームアニメーションのリクエストをキャンセルします。

+ +

構文

+ +
window.cancelAnimationFrame(requestID);
+
+ +

引数

+ +
+
requestID
+
コールバックがリクエストした {{domxref("window.requestAnimationFrame()")}} の呼び出しにより返された ID 値。
+
+ +

+ +
var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
+                            window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+
+var cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame;
+
+var start = window.mozAnimationStartTime;  // Firefox のみでサポート。他のブラウザーでは代わりに Date.now() などを使用してください。
+
+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);
+
+cancelAnimationFrame(myReq);
+
+ +

ブラウザーの実装状況

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
機能ChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
基本サポート21.0 {{property_prefix("webkit")}}
+ 24.0
{{CompatVersionUnknown}}{{CompatGeckoDesktop("11.0")}} {{property_prefix("moz")}}
+ 23.0
1015.06.0 {{property_prefix("webkit")}}
+ 6.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
機能AndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
基本サポート4.433{{CompatVersionUnknown}}{{CompatGeckoMobile("11.0")}} {{property_prefix("moz")}}
+ 23.0
10337.1
+
+ +

仕様

+ + + +

関連情報

+ + -- cgit v1.2.3-54-g00ecf