3 ms·
requestAnimationFrame() is new to me. Sort of a setTimeout() but with the time being "when it is appropriate to draw a new frame". A much more polite way to han
by jws 15y ago
requestAnimationFrame() is new to me. Sort of a setTimeout() but with the time being "when it is appropriate to draw a new frame". A much more polite way to handle animation in the browser, especially when there are multiple independent animations running.
A little article with shim code: http://paulirish.com/2011/requestanimationframe-for-smart-animating/ http://paulirish.com/2011/requestanimationframe-for-smart-an...
Draft: http://webstuff.nfshost.com/anim-timing/Overview.html http://webstuff.nfshost.com/anim-timing/Overview.html
- radarsat1 15y agoI find it surprising to introduce a function intended for animation callback that doesn't seem to provide facilities for time handling. That is, the callback doesn't seem to be provided with the current time, and requestAnimationFrame() does not take a desired FPS as a parameter. .. Sorry the spec does say the callback should be provided the time as an argument. It's just not being used in these examples.