DOCTYPE 标准不能少,在IE6,7,8,FF测试通过,其它的没测试<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title>test</title>
<body>
<script>
var istop;
if(window.parent && window.parent!=window){istop=top.window;}else{istop=window;}
function loadinginfo(){
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var Bind = function(object, fun) {
return function() {
return fun.apply(object, arguments);}
}
var w = istop.document.createElement("div");
w.setAttribute("id","mybody")
with(w.style){
position = "fixed";
zIndex = '10001';
bottom = 0;
left = 0;
width="300px";
height="20px";
backgroundColor="#FF0000";
lineHeight="20px";
fontSize="12px";
textAlign="center";
}
w.innerHTML="数据处理中,请稍候……"
if(isIE6){
w.style.position ="absolute";
w._fixed = Bind(w, function(){
w.style.marginTop = istop.document.documentElement.scrollTop - w.offsetHeight / 2 + "px";
w.style.marginLeft = istop.document.documentElement.scrollLeft+ "px";});
w._fixed()
istop.attachEvent("onscroll", w._fixed);
w.innerHTML =" 数据处理中,请稍候……"+'<iframe style="position:absolute; visibility:inherit; top:0px; left:0px; width:100%; height:100%; z-index:-1;filter:alpha(opacity=0);"></iframe>'
}
istop.document.body.appendChild(w);
}
function loadingClose(){
istop.document.body.removeChild(istop.document.getElementById("mybody"));
}
loadinginfo();
</script>
</body>
</html>

解决方案 »

  1.   

    要关闭就调用函数:loadingClose()
      

  2.   

    不错不错  帮你测了下在IE678 FF3.63  chrome opera safari 都没问题  收藏了
      

  3.   

    我突然发现我白说了  用 postion:fixed 就能兼容除了IE6外所有的浏览器而且你这个IE6效果有问题 有幻影!
      

  4.   

    而且你这样的效果IE6用 expression 就能搞定