Baseline Widely available
window.cancelAnimationFrame()
ã¡ã½ããã¯ã以åã« window.requestAnimationFrame()
ã®å¼ã³åºãã«ãã£ã¦ã¹ã±ã¸ã¥ã¼ã«ãããã¢ãã¡ã¼ã·ã§ã³ãã¬ã¼ã ãªã¯ã¨ã¹ãããã£ã³ã»ã«ãã¾ãã
cancelAnimationFrame(requestID)
弿°
requestID
ã³ã¼ã«ããã¯ããªã¯ã¨ã¹ããã window.requestAnimationFrame()
ã®å¼ã³åºãã«ãã£ã¦è¿ããã ID å¤ã
ãªã (undefined
)ã
const requestAnimationFrame =
window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame;
const cancelAnimationFrame =
window.cancelAnimationFrame || window.mozCancelAnimationFrame;
const start = Date.now();
let myReq;
function step(timestamp) {
const progress = timestamp - start;
d.style.left = `${Math.min(progress / 10, 200)}px`;
if (progress < 2000) {
// requestAnimationFrame ãå¼ã³åºããã³ã« requestId ãæ´æ°ãããã¨ãéè¦ã§ã
myReq = requestAnimationFrame(step);
}
}
myReq = requestAnimationFrame(step);
// ãã£ã³ã»ã«å¦çã¯ãæå¾ã® requestId ã使ç¨ãã¾ã
cancelAnimationFrame(myReq);
仿§æ¸ ãã©ã¦ã¶ã¼ã®äºææ§ é¢é£æ
å ±
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4