// see http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// shim layer with setTimeout fallback | |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
function(callback, element){ | |
window.setTimeout(function(){ | |
callback(+new Date); | |
}, 1000 / 60); | |
}; | |
})(); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
claritysource left this comment but deleted it.... If I'm not mistaken, the original code has the following bugs:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
paulirish
Sep 7, 2011
I've since updated this gist to remove the timeundefined
issue as it was specific to Chrome 10 which is now dead and gone. hooray for software updates!
I've since updated this gist to remove the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Don't use thisuse this:https://gist.github.com/1579671 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
claritysource left this comment but deleted it....
If I'm not mistaken, the original code has the following bugs: