向下兼容
window.requestAnimationFrame=window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame ||
function( callback ){
//为了使setTimteout的尽可能的接近每秒60帧的效果
window.setTimeout(callback,1000/60);
}
window.cancelAnimationFrame=window.cancelAnimationFrame ||
Window.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame ||
window.msCancelAnimationFrame ||
window.oCancelAnimationFrame ||
function( id ){
//为了使setTimteout的尽可能的接近每秒60帧的效果
window.clearTimeout( id );
}
网友评论