博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
页面加载时加Loading效果
阅读量:4358 次
发布时间:2019-06-07

本文共 518 字,大约阅读时间需要 1 分钟。

html


 

<div id="loading"><img src="img/load1.gif" id="loading" /></div>

 

css


#loading {

position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2000;
opacity: 1;
}

#loading img {

width: 100%;
position: absolute;
z-index: 2001;
}

 

js


 

 

//监听加载状态改变

document.onreadystatechange = completeLoading;
//加载状态为complete时移除loading效果
function completeLoading() {
if (document.readyState == "complete") {
$("#loading").animate({
"opacity": "0"
}, 500).hide(1000);
}
}

转载于:https://www.cnblogs.com/weilingfamily/p/9303645.html

你可能感兴趣的文章
getopt、getopt_long 简介
查看>>
Linux eject 命令
查看>>
Python 常用函数
查看>>
作为布尔表达式的时候会被解释器当做False的值
查看>>
linux 网络编程:客户端与服务器通过TCP协议相互通信 + UDP
查看>>
程序人生之我们的故事:十年如歌(9)
查看>>
用户体验之“双语标签”
查看>>
IOS打包和发布简单介绍
查看>>
scp ssh 拷贝文件夹
查看>>
JavaScript学习05 定时器
查看>>
CSS
查看>>
Ubuntu 11.04安装GCC 4.6.1
查看>>
甲骨论
查看>>
C# 集合类-接口
查看>>
InstallShield Limited Edition for Visual Studio 2013 图文教程(教你如何打包.NET程序)
查看>>
基于visual Studio2013解决面试题之1004最长等差数列
查看>>
联系方式
查看>>
基于visual Studio2013解决C语言竞赛题之0707月份输出
查看>>
【leetcode】Triangle
查看>>
PostgreSQL9.1 with PostGIS 2.1.4 for mapping coordinates on linux/ubuntu 已经打包成deb 可下载...
查看>>