JS适配问题。
Posted penn-wang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JS适配问题。相关的知识,希望对你有一定的参考价值。
动画requestAnimFrame + cancelAnimationFrame
window.requestAnimFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function( callback ){ window.setTimeout(callback, 1000 / 60); }; })(); window.cancelAnimationFrame =(function(){ return window.cancelAnimationFrame || window.cancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelAnimationFrame || window.mozCancelRequestAnimationFrame || window.msCancelAnimationFrame || window.msCancelRequestAnimationFrame || window.oCancelAnimationFrame || window.oCancelRequestAnimationFrame || window.clearTimeout; })();
以上是关于JS适配问题。的主要内容,如果未能解决你的问题,请参考以下文章