loading.js 1.1 KB

12345678910111213
  1. var _PageHeight = document.documentElement.clientHeight,
  2. _PageWidth = document.documentElement.clientWidth;
  3. var _LoadingTop = _PageHeight > 61 ? (_PageHeight - 61) / 3: 0,
  4. _LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2: 0;
  5. var _LoadingHtml = '<div id="loadingDiv" style="position:absolute;left:0;width:100%;height:' + _PageHeight + 'px;top:0;background:#f3f8ff;opacity:0.8;filter:alpha(opacity=80);z-index:10000;"><div style="position: absolute; cursor1: wait; left: ' + _LoadingLeft + "px; top:" + _LoadingTop + "px; width: auto; height: 57px; line-height: 57px; padding-left: 40px; padding-right: 20px; background: #fff url(../images/loading.gif) no-repeat scroll 15px 20px; border: 2px solid #95B8E7; color: #333;font-size:14px; font-family:'Microsoft YaHei';\">页面加载中,请等待...</div></div>";
  6. document.write(_LoadingHtml);
  7. document.onreadystatechange = completeLoading;
  8. function completeLoading() {
  9. if (document.readyState == "complete") {
  10. var loadingMask = document.getElementById("loadingDiv");
  11. loadingMask.parentNode.removeChild(loadingMask)
  12. }
  13. };