三种CSS方法实现loadingh点点点的效果
我们在提交数据的时候,在开始提交数据与数据提交成功之间会有一段时间间隔,为了有更好的用户体验,我们可以在这个时间段添加一个那处点点点的动画,如下图所示:
汇总了一下实现这种效果主要有三种方法:
第一种:box-shadow + animate;
第二种:animate;
第三种:等宽字体 + animate
具体代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>实现loadingh点点点的效果</title>
<style type="text/css">
/* box-shadow+animate方法 */
.shadow_dot {
display: inline-block; min-width: 2px; min-height: 2px;
box-shadow: 2px 0 currentColor, 6px 0 currentColor, 10px 0 currentColor;
-webkit-animation: shadow_dot 4s infinite step-start both;
animation: shadow_dot 4s infinite step-start both;
*zoom: expression(this.innerHTML = '...'); /* IE7 */
}
.shadow_dot:before { content: '...'; } /* IE8 */
.shadow_dot::before { content: ''; }
:root .shadow_dot { margin-right: 8px; } /* IE9+,FF,CH,OP,SF */ @-webkit-keyframes shadow_dot {
25% { box-shadow: none; }
50% { box-shadow: 2px 0 currentColor; }
75% { box-shadow: 2px 0 currentColor, 6px 0 currentColor; }
}
@keyframes shadow_dot {
25% { box-shadow: none; }
50% { box-shadow: 2px 0 currentColor; }
75% { box-shadow: 2px 0 currentColor, 6px 0 currentColor; }
} /* animate方法 */
.ani_dot {
font-family: simsun;
}
:root .ani_dot { /* 这里使用Hack是因为IE6~IE8浏览器下, vertical-align解析不规范,值为bottom或其他会改变按钮的实际高度*/
display: inline-block;
width: 1.5em;
vertical-align: bottom;
overflow: hidden;
}
@-webkit-keyframes dot {
0% { width: 0; margin-right: 1.5em; }
33% { width: .5em; margin-right: 1em; }
66% { width: 1em; margin-right: .5em; }
100% { width: 1.5em; margin-right: 0;}
}
.ani_dot {
-webkit-animation: dot 3s infinite step-start;
} @keyframes dot {
0% { width: 0; margin-right: 1.5em; }
33% { width: .5em; margin-right: 1em; }
66% { width: 1em; margin-right: .5em; }
100% { width: 1.5em; margin-right: 0;}
}
.ani_dot {
animation: dot 3s infinite step-start;
} /* 等宽字体+animate方法 */
dot {
display: inline-block;
width: 3ch;
text-indent: -1ch;
vertical-align: bottom;
overflow: hidden;
animation: dot 3s infinite step-start both;
/* 等宽字体很重要 */
font-family: Consolas, Monaco, monospace;
} @keyframes dot {
33% { text-indent: 0; }
66% { text-indent: -2ch; }
} </style>
</head>
<body>
<h3>利用box-shadow实现:</h3>
<div>
数据提交中<span class="shadow_dot"></span>
</div> <h3>animate方法:</h3>
<div>
数据提交中<span class="ani_dot">...</span>
</div> <h3>等宽字体+animate方法:</h3>
<div>
数据提交中<span>...</span>
</div>
</body>
</html>
大家可以自己动手实践一下~~
这三种方法来源地址如下:
再说CSS3 animation实现点点点loading动画
小tip: CSS3 animation渐进实现点点点等待提示效果
三种CSS方法实现loadingh点点点的效果的更多相关文章
- Liunx 环境下vsftpd的三种实现方法(超详细参数)
以下文章介绍Liunx 环境下vsftpd的三种实现方法 ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.0.3.tar.gz,目前已经到2.0.3版本.假 ...
- javase-常用三种遍历方法
javase-常用三种遍历方法 import java.util.ArrayList; import java.util.Iterator; import java.util.List; public ...
- JS面向对象(3) -- Object类,静态属性,闭包,私有属性, call和apply的使用,继承的三种实现方法
相关链接: JS面向对象(1) -- 简介,入门,系统常用类,自定义类,constructor,typeof,instanceof,对象在内存中的表现形式 JS面向对象(2) -- this的使用,对 ...
- Java中Map的三种遍历方法
Map的三种遍历方法: 1. 使用keySet遍历,while循环: 2. 使用entrySet遍历,while循环: 3. 使用for循环遍历. 告诉您们一个小秘密: (下↓面是测试代码,最爱看 ...
- Jquery中each的三种遍历方法
Jquery中each的三种遍历方法 $.post("urladdr", { "data" : "data" }, function(dat ...
- spring与mybatis三种整合方法
spring与mybatis三种整合方法 本文主要介绍Spring与Mybatis三种常用整合方法,需要的整合架包是mybatis-spring.jar,可通过链接 http://code.googl ...
- C#使用DataSet Datatable更新数据库的三种实现方法
本文以实例形式讲述了使用DataSet Datatable更新数据库的三种实现方法,包括CommandBuilder 方法.DataAdapter 更新数据源以及使用sql语句更新.分享给大家供大家参 ...
- struts2拦截器interceptor的三种配置方法
1.struts2拦截器interceptor的三种配置方法 方法1. 普通配置法 <struts> <package name="struts2" extend ...
- selenium webdriver三种等待方法
webdriver三种等待方法 1.使用WebDriverWait from selenium import webdriverfrom selenium.webdriver.common.by im ...
随机推荐
- Linux shell 提取文件名和目录名
${}用于字符串的读取,提取和替换功能,可以使用${} 提取字符串 1.提取文件名 [root@localhost log]# var=/dir1/dir2/file.txt [root@localh ...
- Android媒体扫描详细解析之二(MediaScanner & MediaProvider)
上篇blog说到了经过对文件夹进行扫描如果后缀符合系统设定的一些格式,那么就会进行文件内容扫描下面我们紧接着STEP 14中的 status_t StagefrightMediaScanner::pr ...
- 记一发Hive on tez的配置(Hive 3.1.1, Hadoop 3.0.3, Tez 0.9.1)
直接下载Tez的binary包部署安装是有问题的,因为默认支持hadoop版本为2.7,2.7以上的就需要手动编译了. 下载Tez源码 CD到源码文件夹,mvn install -Dhadoop.ve ...
- react 中使用 lodash 中的 _.throttle
1.场景: 首次调用执行一次,一定时间内再次调用,不再执行. 2.实现 debounce (函数去抖) 多次触发,只在最后一次触发时,执行目标函数. _.debounce(func, [wait=0] ...
- Java开发环境配置(Win7 64位系统/server 2008)
下面以jdk1.8.0_05版本为例: 1.在用户变量里新增变量名:JAVA_HOME 变量值:D:\Java\jdk1.8.0_05 (根据实例路径变换) 2.在用户变量里新增变量名:CLASSPA ...
- Entity Framework Code First关系映射约定【l转发】
本篇随笔目录: 1.外键列名默认约定 2.一对多关系 3.一对一关系 4.多对多关系 5.一对多自反关系 6.多对多自反关系 在关系数据库中,不同表之间往往不是全部都单独存在,而是相互存在关联的.两个 ...
- Orcla 数据库复习2 --子查询和表连接
子查询和表连接 ①.查询挣钱最多的人的名字 SELECT ename,sal FROM emp WHERE sal=(SELECT MAX(sal) FROM emp); ②.查询有哪些人的工 ...
- linux内核——进程切换宏switch_to
该宏有三个参数:prev, next, last.它们都是局部变量. prev:输入参数,变量值为旧进程描述符的地址. next:输入参数,变量值为新进程描述符的地址. last:输出参数,用来记录该 ...
- spring注解 annotation
@Resourse(name=" xxx") 意味从上下文找xxx名字一样的然后引入 @Repository("personDao") 意味生成一个 bean ...
- LaTex 常见错误及解决办法
出现错误: Multirow 要用库的 导入\usepackage{multirow} ,,即可