方法一:
function show(){
console.log(1);
requestAnimationFrame(show);
}
show();
方法二:
function show2(){
setTimeout(function(){
console.log(2)
setTimeout(arguments.callee,1000/60);
},1000/60);
}
show2();
function show(){
console.log(1);
requestAnimationFrame(show);
}
show();
function show2(){
setTimeout(function(){
console.log(2)
setTimeout(arguments.callee,1000/60);
},1000/60);
}
show2();
本文标题:javascript实现稳定动画帧数的两种方法
本文链接:https://www.haomeiwen.com/subject/ydlutftx.html
网友评论