Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 401 Bytes

cancel-requestAnimationFrame.md

File metadata and controls

11 lines (8 loc) · 401 Bytes

Cancel requestAnimationFrame() (2016-08-15)

requestAnimationFrame() returns an ID which can be used to cancel the "request" later, using cancelAnimationFrame():

var id = window.requestAnimationFrame(function() { ... });
...
cancelAnimationFrame(id);

Of course, this works on modern browsers.