// 先写一个动画实现从禁用到可点击的变化
@keyframes throttle {
from {
pointer-events: none;
}
to {
pointer-events: all;
}
}
// 然后将动画绑定到按钮上
button{
animation: throttle 2s step-end forwards;
}
// 点击时候将动画清空,点击后动画开始
button:active{
animation: none;
}
纯css按钮禁用