用于列表下拉加载loading动画

时间:2022-07-23
本文章向大家介绍用于列表下拉加载loading动画,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

一、效果图

弹跳加载

二、实现代码

<view class="bouncing-loader">
  <view></view>
  <view></view>
  <view></view>
</view> 
@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;
}