HTML5 Canvas Animation with requestAnimFrame

To create an animation using HTML5 Canvas, we can use the requestAnimFrame shim which enables the browser to determine the optimal FPS for our animation.  For each animation frame, we can update the elements on the canvas, clear the canvas, redraw the canvas, and then request another animation frame.

Code Editor

Modified on April 9th, 2013 by Eric Rowell
comments powered by Disqus