Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. window.requestNextAnimationFrame = (function () {
  2. var self = this;
  3. return window.requestAnimationFrame ||
  4. window.webkitRequestAnimationFrame ||
  5. window.mozRequestAnimationFrame ||
  6. window.oRequestAnimationFrame ||
  7. window.msRequestAnimationFrame ||
  8. function (callback, element) {
  9. var start, finish;
  10. window.setTimeout(function () {
  11. start = +new Date();
  12. callback(start);
  13. finish = +new Date();
  14. self.timeout = 1000 / 60 - (finish - start);
  15. }, self.timeout);
  16. };
  17. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement