function throttle(fn, delay) {
var timer = null;
return function () {
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
};
}
JavaScript 函数节流
最新推荐文章于 2024-11-13 15:29:17 发布