用于列表下拉加载loading动画

2020-08-24 12:39:51 浏览数 (2)

一、效果图

弹跳加载

二、实现代码

代码语言:javascript复制
<view class="bouncing-loader">
  <view></view>
  <view></view>
  <view></view>
</view> 
代码语言:javascript复制
@keyframes bouncing-loader {
  to {
    opacity: 0.1;
    transform: translate3d(0, -20rpx, 0);
  }
}
.bouncing-loader {
  display: flex;
  justify-content: center;
}
.bouncing-loader > view {
  width: 15rpx;
  height: 15rpx;
  margin: 30rpx 2rpx;
  background: red;
  border-radius: 50%;
  animation: bouncing-loader 0.6s infinite alternate;
}
.bouncing-loader > view:nth-child(2) {
  animation-delay: 0.2s;
}
.bouncing-loader > view:nth-child(3) {
  animation-delay: 0.4s;
}

0 人点赞