css3加载中蒙层

 

	var _PageHeight = document.documentElement.clientHeight,
	  _PageWidth = document.documentElement.clientWidth;
	//计算loading框距离顶部和左部的距离(loading框的宽度为215px,高度为61px)
	var _LoadingTop = _PageHeight > 61 ? (_PageHeight - 61) / 2 : 0,
	  _LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2 : 0;
	//在页面未加载完毕之前显示的loading Html自定义内容
	var _LoadingHtml = '
页面加载中,请等待...
'; //呈现loading效果 document.write(_LoadingHtml); //window.onload = function () { // var loadingMask = document.getElementById('loadingDiv'); // loadingMask.parentNode.removeChild(loadingMask); //}; //监听加载状态改变 document.onreadystatechange = completeLoading; //加载状态为complete时移除loading效果 function completeLoading() { if (document.readyState == "complete") { var loadingMask = document.getElementById('loadingDiv'); loadingMask.parentNode.removeChild(loadingMask); } }



.loading {
margin: .4rem;
text-align: center;
width: 100%;
}
.mask {
/*display: none; */
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.7;
opacity:.70;
filter: alpha(opacity=70);
}


  

转载于:https://www.cnblogs.com/dontes/p/9619446.html

你可能感兴趣的:(css3加载中蒙层)