use requestAnimationFrame for better fps performance.

https://developer.mozilla.org/nl/docs/DOM/window.requestAnimationFrame
http://creativejs.com/resources/requestanimationframe/