requestAnimationFrame polyfill
/*
requestAnimationFrame polyfill, by Mark Vasilkov
Released into the public domain.
*/
if (typeof requestAnimationFrame === "undefined") {
["moz", "webkit", "ms"].some(function(p) {
var fun = this[p + "RequestAnimationFrame"]
if (typeof fun === "function") {
return requestAnimationFrame = fun
}
}) || (requestAnimationFrame = function(fun) {
setTimeout(fun, 16)
})
}
Written by Mark Vasilkov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#