首页 > Web开发 > 详细

常见的网页加载进度条

时间:2017-09-03 18:22:38      阅读:135      评论:0      收藏:0      [点我收藏+]

 

		<style type="text/css">
			/*遮罩在加载页面上的div样式*/
			.loading{
				width: 100%;
				height: 100%;
				position: fixed;
				top: 0;
				left: 0;
				z-index: 100;
				background: white;
			}
			/*动态图片*/
			.pic{
				width: 64px;
				height: 64px;
				background: url(img/loading.gif);
				position: absolute;
				top: 0;
				bottom: 0;
				left: 0;
				right: 0;
				margin: auto;
			}
		</style>
		<script type="text/javascript">
			/*定时器加载*/
			/*$(function(){
				setInterval(function(){
					$(".loading").fadeOut();
				},3000);
				
			});*/
			
			/*通过加载状态事件*/
			document.onreadystatechange = function(){
				
				if(document.readyState == ‘complete‘){
					
					$(".loading").fadeOut();
				}
			}
			
		</script>
        <body>
                <div class="loading">
			<div class="pic"></div>			
		</div>    
        </body>

  

常见的网页加载进度条

原文:http://www.cnblogs.com/vijayxu/p/7470266.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!