Remember: Run your animations with requestAnimationFrame

Why do you want to start with requestAnimationFrame, instead of passing in a time value?
  1. performance.now is not widely supported
  2. Date.now() may not give you the same format as used by requestAnimationFrame. In fact most cases where requestAnimationFrame is natively supported it doesn't.
  3. Starting your animation with it insures that it passes in the correct time format.


So use it.
Need a polyfill use this one by +Paul Irish  .

Comments

Popular Posts