当前位置:主页 > 网页前端 > JavaScript代码 >

微信小程序按钮点击动画效果的实现

时间:2021-04-28 08:08:29 | 栏目:JavaScript代码 | 点击:

动画效果如下:

在这里插入图片描述

GIF看起来可能会有点卡

wxml

<view class="confirm bubble">确定</view>

wxss

.confirm{
 width: 325rpx;
 height: 80rpx;
 background: #07c160;
 border-radius: 6rpx;
 font-size: 30rpx;
 color: #fff;
 line-height: 80rpx;
 text-align: center;
 
}
.bubble{ 
 position: relative;
 overflow: hidden;
}
.bubble:after{
 content: "";
 background: #999;
 position: absolute; 
 width: 750rpx;
 height: 750rpx;
 left: calc(50% - 375rpx);
 top: calc(50% - 375rpx);
 opacity: 0;
 margin: auto;
 border-radius: 50%;
 transform: scale(1);
 transition: all 0.4s ease-in-out;
}
.bubble:active:after {
 transform: scale(0);
 opacity: 1;
 transition: 0s;
}

总结

您可能感兴趣的文章:

相关文章