html代码:
<body>
<h1>❤</h1>
</body>
css代码:
h1{
font-size: 50px;
color: pink;
text-align: center;
}
h1.active{
-webkit-animation:a_z 1.2s linear forwards;
}
@-webkit-keyframes a_z{
60%{
transform:translate3d(0,0,0) scaleX(1.3) scaleY(1.3)
-webkit-transform:translate3d(0,0,0) scaleX(1.3) scaleY(1.3);
}
to{
transform:translate3d(0,0,0) scaleX(1) scaleY(1)
-webkit-transform:translate3d(0,0,0) scaleX(1) scaleY(1);
}
}
js代码:
$("h1").on("click",function(){
if(!$(this).is(".active")){
$(this).addClass("active");
}
})