js防抖

js防抖

let telInput=document.querySelector("input") telInput.addEventListener('input',noDou(demo,1000)) //防抖封装 function noDou(fn,wait){ let timeOut=null; return args=>{ if(timeOut) clearTimeout(timeOut) timeOut=setTimeout(fn,wait) } }

Copyright © 2020-2023 春藤技术,春藤建站 All Rights Reserved
备案号:豫ICP备20020705号 公网安备 51LA统计