特牛生活网

函数节流-CSDN博客

网友收藏
文章浏览阅读89次。简洁版:function throttle(fn, content){ clearTimeout(fn.timer); fn.timer = setTimeout(function(){ fn.call(content) },1000)}第一次调用有延迟。时间戳方式:function throttle(fn, gapTi..._function throttle(fn)