KELEN / blog-comment

0 stars 0 forks source link

js防抖和节流 - Kelen's Blog #117

Open KELEN opened 8 months ago

KELEN commented 8 months ago

https://www.kelen.cc/posts/js-debounce-and-throttle

在写前端脚本的时候,有时候会某一时间短时间内触发多次事件,例如mouseover,resize,scroll函数,如果在这些回调执行复杂的操作,那么会导致页面卡顿,所以必须采取一些措施,我们想要的是在某一连续操作的时间内,不触发操作