Hacker News new | ask | show | jobs
by program 5028 days ago
I got nice quality on Chrome 21. Substitute the window.requestAnimationFrame directive with:

  window.requestAnimationFrame = (function() {
    return window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
    window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
    window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); };
  })();
and it will work in Opera 12 too.
1 comments

Wow, I was sure they implemented requestAnimationFrame already!

Anyway, I limited myself to trying out the various vendors' prefixes; this being mainly an experiment/preview I'd rather keep the code clean than support non-cutting-edge browsers.

I'll update the paragraph about the compatibility though; thanks for the heads up!