首页 > 代码库 > 加载页面(Loading)

加载页面(Loading)

/*
文件说明:页面加载时Loading JS
文件描述:解决IE或FF下,初始化加载时,页面布局乱掉的问题,参考:
*/
var width = $(window).width();
var height = $(window).height();

var html = "<div id=‘loading‘ style=‘position:absolute;left:0;z-index:999999;width:100%;height:" + height + "px;top:0;background:#E0ECFF;opacity:1;filter:alpha(opacity=100);‘>";
html += "<div style=‘position:absolute;cursor1:wait;z-index:999999;left:" + ((width / 2) - 75) + "px;top:200px;width:150px;height:16px;padding:12px 5px 10px 40px;";
html += "background:#fff url(../../Content/images/loading.gif) no-repeat scroll 5px 5px;border:2px solid #ccc;color:#000;‘>";
html += "正在加载请稍后....";
html += "</div>";
html += "</div>";

window.onload = function () {
var mask = document.getElementById(‘loading‘);
mask.parentNode.removeChild(mask);
};
document.write(html);

加载页面(Loading)