requestAnimationFrame is more compatible.