diff options
Diffstat (limited to 'files/ko/web/api/window/cancelanimationframe')
-rw-r--r-- | files/ko/web/api/window/cancelanimationframe/index.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/files/ko/web/api/window/cancelanimationframe/index.html b/files/ko/web/api/window/cancelanimationframe/index.html new file mode 100644 index 0000000000..51c506a7e3 --- /dev/null +++ b/files/ko/web/api/window/cancelanimationframe/index.html @@ -0,0 +1,72 @@ +--- +title: window.cancelAnimationFrame() +slug: Web/API/Window/cancelAnimationFrame +tags: + - API + - DOM + - 레퍼런스 + - 메소드 + - 실험적 + - 애니메이션 + - 윈도우 +translation_of: Web/API/Window/cancelAnimationFrame +--- +<div>{{APIRef}}</div> + +<p><code><strong>window.cancelAnimationFrame()</strong></code> 메소드는 이전에 {{domxref("window.requestAnimationFrame()")}} 을 호출하여 스케줄된 애니메이션 프레임 요청을 취소합니다.</p> + +<h2 id="구문">구문</h2> + +<pre class="syntaxbox">window.cancelAnimationFrame(<em>requestID</em>); +</pre> + +<h3 id="Parameters">Parameters</h3> + +<dl> + <dt><code>requestID</code></dt> + <dd>요청된 콜백 {{domxref("window.requestAnimationFrame()")}} 을 호출하여 반환된 ID 값.</dd> +</dl> + +<h2 id="예시">예시</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; // 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); +</pre> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + +<div> + + +<p>{{Compat("api.Window.cancelAnimationFrame")}}</p> +</div> + +<h2 id="명세">명세</h2> + +<ul> + <li>{{spec("https://www.w3.org/TR/html51/webappapis.html#animation-frames", "Timing control for script-based animations: cancelAnimationFrame", "WD")}}</li> +</ul> + +<h2 id="함께_보기">함께 보기</h2> + +<ul> + <li>{{domxref("window.mozAnimationStartTime")}}</li> + <li>{{domxref("window.requestAnimationFrame()")}}</li> +</ul> |