https://github.com/mqyqingfeng/Blog/issues/26
function throttle(func, wait) {
var timeout;
var previous = 0;
return function() {
var context = this;
var args = arguments;
if (!timeout) {
timeout = setTimeout(function(){
timeout = null;
func.apply(context, args)
}, wait)
}
}
}
网友评论