try use requestAnimationFrame