使用定时器分解任务
使用定时器分解任务主要是针对那些比较影响性能,阻塞页面进程且无需同步的逻辑
function processArray(items,process,callback){
var todo=items.concat();
setTimeout(function(){
process(todo.shift());
if(todo.length>0){
setTimeout(arguments.callee,25)
}
},25);
}

浙公网安备 33010602011771号