常见的网页加载进度条

 

		<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>

  

posted @ 2017-09-03 17:47  vijayxu  阅读(124)  评论(0编辑  收藏  举报