<button onclick="console.log('触发')">点击按钮</button>
<style>
button{
/* step-end是阶梯性效果,当动画时间到了,则动画立即执行完成,不会有过渡延时效果 */
animation: aName 1s step-end forwards;
}
button:active{
animation: none;
}
@keyframes aName {
from{
color:brown;
/*控制元素是否对鼠标做出反应 设置此值之后则元素不能对鼠标做出反应 */
pointer-events: none;
}
to{
color:rgb(63, 221, 63);
/*auto是可以对鼠标做出反应的*/
pointer-events:auto;
}
}
</style>