问题:1 Loading显示时,Helloworld不应该显示,但显示了。 是DIV没有盖住后面部分?
2 在别的机器测试,连Helloworld都不显示。 不管是加载完还是加载前。
3 还有,在火狐下,一直是图片加载状态。。是火狐不支持Onload事件吗? 还是Js写得有问题呢?代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
    <link href="css_js/Loading.css" rel="stylesheet" type="text/css" />    <script type="text/javascript">
      var hid=function hd(){
      
      document.getElementById("loading").style.display="none";     
      }  
      
      function hh(){
      setTimeout(hd,3000);      
      }
    </script></head>
<body onload="hh()">
    <div id="loading" style="background-color: Blue; left: 45%; top: 40%;">
        <div class="loading-indicator">
            <img src="Images/extanim32.gif" alt="" width="32" height="32" style="margin-right: 8px;"
                align="absmiddle" />
            Loading......
        </div>
    </div>
    <div id="loading-mask" style="left: 0px; top: 0px;">
    </div>
    Hello world
</body>
</html>
Css:body {
}
.loading-indicator {
    font-size:11px;
    background-image:url('../Images/loading.gif');
    background-repeat: no-repeat;
    background-position:top left;
    padding-left:20px;
height:18px;
text-align:left;
}
#loading-mask{
position:absolute;
left:0;
top:0;
    width:100%;
    height:100%;
    z-index:20000;
    background-color:white;
}
#loading{
position:absolute;
left:45%;
top:40%;
padding:2px;
z-index:20001;
    height:auto;
}
#loading img {
    margin-bottom:5px;
}
#loading .loading-indicator{
background:white;
color:#555;
font:bold 13px tahoma,arial,helvetica;
padding:10px;
margin:0;
    text-align:center;
    height:auto;
}