html跳动按钮效果,html – 使用CSS3使按钮弹跳

您可以使用关键帧动画来设置按钮缩放比例的动画并使其反弹:

.order {

position: absolute;

top: 50px;

left: 50px;

width: 75px;

line-height: 75px;

text-align:center;

opacity: 1;

background: green;

color:#fff;

border-radius:50%;

-webkit-animation: bounce .3s infinite alternate;

-moz-animation: bounce .3s infinite alternate;

animation: bounce .3s infinite alternate;

}

@-webkit-keyframes bounce {

to { -webkit-transform: scale(1.2); }

}

@-moz-keyframes bounce {

to { -moz-transform: scale(1.2); }

}

@keyframes bounce {

to { transform: scale(1.2); }

}

Order

迭代次数:

如果你想在一些“反弹”之后停止动画,你可以使用animation-iteration-count(使用偶数次迭代,否则动画会在最后捕捉):

.order {

position: absolute;

top: 50px;

left: 50px;

width: 75px;

line-height: 75px;

text-align:center;

opacity: 1;

background: green;

color:#fff;

border-radius:50%;

-webkit-animation: bounce .3s infinite alternate;

-moz-animation: bounce .3s infinite alternate;

animation: bounce .3s infinite alternate;

-webkit-animation-iteration-count: 8;

-moz-animation-iteration-count: 8;

animation-iteration-count: 8;

}

@-webkit-keyframes bounce {

to { -webkit-transform: scale(1.2); }

}

@-moz-keyframes bounce {

to { -moz-transform: scale(1.2); }

}

@keyframes bounce {

to { transform: scale(1.2); }

}

Order
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值