<body>
处理高频触发的事件或者交互动画,只执行最后一次
<script>
let fn = function(){
console.log('11')
}
window.onresize = function(){
clearTimeout(fn.id)
fn.id = setTimeout(() => {
fn()
}, 1000)
}
</script>
</body>
网友评论