requestAnimationFrame, setInterval, and setTimeout

4

I would like to understand more about the nature of these three functions mentioned above. What is the main objective for each one? When it comes to animations, what is the best option for DOM changes?

    
asked by anonymous 30.11.2015 / 20:38

1 answer

1

For what I've used

requestAnimationFrame It's more for games or animations, it's like a set interval only without problems with the difference of MS from one computer to another, came along with CSS3 and HTML5 link

SetInterval is the method to perform an ac action X milliseconds link

SetTimeout is the method that runs a method ONLY ONCE after X milliseconds link

Depending on the animation you should use css3

link

    
01.12.2015 / 17:10