March 14, 2013Simple Animations Using requestAnimationFrame Animating DOM elements involves modifying a CSS style every few milliseconds to give the illusion of movement. This means passing in a callback function to setTimeout and modifying the node’s style object within that callback. Then calling setTimeout again to queue the next animation frame. From the ashes of the phoenix rises a new helper
![Simple Animations Using requestAnimationFrame — SitePoint](https://cdn-ak-scissors.b.st-hatena.com/image/square/26e92c2ab218940101f2567d3b0c5ad322d10307/height=288;version=1;width=512/https%3A%2F%2Fwww.sitepoint.com%2Fwp-content%2Fthemes%2Fsitepoint%2Fassets%2Fimages%2Ficon.javascript.png)