js防抖节流
2021-03-13 17:29
阅读:341
标签:UNC class null on() bounce csharp deb return div js防抖节流 标签:UNC class null on() bounce csharp deb return div 原文地址:https://www.cnblogs.com/fm060/p/12817975.html
debounce(fn,delay=500) {
let timer = null
return function(){
if(timer){
clearTimeout(timer)
}
timer = setTimeout(fn,delay)
}
}
评论
亲,登录后才可以留言!