Skip to content

Instantly share code, notes, and snippets.

View MrZhouZh's full-sized avatar
💭
I may be slow to respond.

Jace Chow MrZhouZh

💭
I may be slow to respond.
View GitHub Profile
@MrZhouZh
MrZhouZh / rAF.js
Created July 15, 2023 08:08 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];