css依次出现三个点用于加载中(...)

在这里插入图片描述
1 wxml

  <view>正在连接设备,请稍后<text class="dotting"></text></view>  

2 css

.dotting { display: inline-block; width: 10px; min-height: 2px;
            padding-right: 2px;
            border-left: 2px solid currentColor; border-right: 2px solid currentColor;
            background-color: currentColor; background-clip: content-box;
            box-sizing: border-box;
            -webkit-animation: dot 1.5s infinite step-start both;
            animation: dot 1.5s infinite step-start both;
 }
 .dotting::before { content: ''; }
  @keyframes dot {
            25% { border-color: transparent; background-color: transparent; }
            50% { border-right-color: transparent; background-color: transparent; }
            75% { border-right-color: transparent; }
  }
 /** 其他内核浏览器,用于pc*/
 .dotting:before { content: '...'; } /* IE8 */
  :root .dotting { margin-left: 2px; padding-left: 2px; } /* IE9+ */
 @-o-keyframes dot {
            25% { border-color: transparent; background-color: transparent; }
            50% { border-right-color: transparent; background-color: transparent; }
            75% { border-right-color: transparent; }
 }
 @-ms-keyframes dot {
            25% { border-color: transparent; background-color: transparent; }
            50% { border-right-color: transparent; background-color: transparent; }
            75% { border-right-color: transparent; }
 }
@-moz-keyframes dot {
            25% { border-color: transparent; background-color: transparent; }
            50% { border-right-color: transparent; background-color: transparent; }
            75% { border-right-color: transparent; }
 }
 @-webkit-keyframes dot {
            25% { border-color: transparent; background-color: transparent; }
            50% { border-right-color: transparent; background-color: transparent; }
            75% { border-right-color: transparent; }
 }

发布了70 篇原创文章 · 获赞 67 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_37896578/article/details/103632694