var throttle={
timeoutId:null,
performProcessing:function(){
},
process:function(){
clearTimeout(this.timeoutId);
var that =this;
this.timeoutId=setTimeout(function(){
that.performProcessing();
},100)
}
}
throttle.process();
function Throttle(method,context){
clearTimeout(method.id);
method.id=setTimeout(function(){
method.call(context)
},100)
}
throttle-javascript高级程序设计
最新推荐文章于 2024-06-24 17:29:14 发布