Try to fix flickering in some browsers with window.requestAnimationFrame.