Up to date polyfill for requestAnimationFrame

后端 未结 5 943
北恋
北恋 2021-01-12 02:51

http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision tells me that recently (Chrome 20) requestAnimationFrame has gained a new

5条回答
  •  萌比男神i
    2021-01-12 03:21

    Paul Irish has suggested a polyfill for this.

    window.requestAminFrame = (function(){
        return window.requestAminFrame || window.webkitRequestAnimFrame || window.mozRequestAnimFrame || window.msRequestAnimFrame || window.oRequestAnimFrame || function(func){return setTimeout(func,1/60);};
    })();
    

提交回复
热议问题