"window.requestAnimationFrame schedules a function to be executed at the next frame, similar to setTimeout(fn, 0). This is super useful because we can use it to schedule all our DOM writes to run together in the next frame, leaving all DOM reads to run in the current synchronous turn."

http://wilsonpage.co.uk/preventing-lay…