这篇文章通过实例代码给大家介绍了HTML5等待加载动画效果的完美解决方案,感兴趣的朋友参考下吧
废话不多说了,直接给大家贴代码了,具体代码如下所示:
<p class="loading">
<p>100<span></span></p>
</p>登录后复制
*{margin:0;padding:0;}
.loading{
height:100%;width:100%;position:fixed;background:rgba(255,255,255,1);
}
.loading >p{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;height:160px;width:160px;text-align: center;line-height:160px;font-size: 30px;color:#f00;}
.loading p span{position:absolute;display:block;height:140px;width:140px;margin:10px;border-radius:50%;-webkit-box-shadow:0 2px 3px rgba(102,197,37,0.8); animation:loading ease 1s infinite;left:0;top:0;}
@keyframes loading{
0%{transform:rotate(0deg)}
100%{transform:rotate(360deg)}
}登录后复制

<p class="loading">
<p>
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
</p>
</p>登录后复制
*{margin:0;padding:0;}
.loading{
height:100%;width:100%;position:fixed;background:rgba(255,255,255,0.95);
}
.loading >p{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;height:30px;width:120px;}
.loading >p i{display: block;float:left;margin:0 5px; width:5px;height:30px;background:#f00;transform:scaleY(0.3);
animation:loading 1s ease infinite alternate;
}
.loading >p i:nth-child(2){animation-delay:0.1s;}
.loading >p i:nth-child(3){animation-delay:0.2s;}
.loading >p i:nth-child(4){animation-delay:0.3s;}
.loading >p i:nth-child(5){animation-delay:0.4s;}
@keyframes loading{
0,40%,100%{transform:scaleY(0.3);}
20%{transform:scaleY(1);}
}登录后复制

其实我想做的是加载进度条效果,但是假的进度条太烂,真的又没有特别好的办法,判断图片这种总感觉比较漏。
这是代码,有完美解决方案了解决。
<script>
document.onreadystatechange=function(){
if(document.readyState=='complete'){
$('.loading').fadeOut();
}
}
</script>登录后复制
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!
相关教程推荐
- 基于HTML5陀螺仪实现移动动画效果
- H5的服务器推送事件详解
- mui的页面跳转方式
- H5的拖放功能详解
- html5新增加的标签有哪些
- H5添加语音输入功能
- H5的头部meta标签如何使用
- H5最全面解读
- 怎样用H5Canvas实现3D动态Chart图表
- 关于老版本的浏览器不兼容H5和C3的处理方法
- html5中重新加载音频/视频元素的方法load()
- HTML5的data-*自定义属性是什么
- AugularJS基础入门与实践
- 如何使用HTML5File接口在web页面上使用文件下载
- 详解HTML5中表单验证的8种方法介绍
- Vue.directive()的图文详解
- 在H5页面中怎样调用APP
- HTML5设置视频背景的方法介绍
- html5是什么意思
- html5编辑器有哪些
其他课程推荐
- php添加pcntl多线程扩展(Linux)
- php linux解决方案
- imagegif函数linux下失败,windows下成功,为什么?解决思路
- linux下怎么安装php的扩展库
- 学习PHP,然后学习C,深入Linux的,如果想往底层发展,应该是如何的一个学习过程?
- Perl、PHP、Python、Ruby对于入门的Linux运维来说,哪个更易学?
- linux下安装redis以及phpRedis扩展
- Cygwin下安装LinuxPHP环境和Swoole扩展并在PHPStorm中调试
- Linux下C++实现PHP扩展
- linuxphp5.3.x升级到php5.5.x
- 【Linux】LAMP架构之以模块方式让php和httpd搭档工作
- linux php fopen怎么打不开远程文件?
- PHP施行linux命令
- Linuxservice服务管理
- Linux配置主机名
- Linux网络配置~修改IP地址
- Linuxvi/vim编辑器
- 为什么要学linux
- Linux
- Linux下MySQL出现#1036–Table‘‘isreadonly错误解决方法