<body id="gn"></body>
<script language="javascript">
function $$(titleName)
{
return document.createElement(titleName);
}
function $(e)
{
return document.getElementById(e);
}
var lodingBox = $$("div");
lodingBox.style.position="fixed";//火狐的正确。ie8没效果
lodingBox.style.width=screen.width+"px";
lodingBox.style.height=screen.height+"px";
lodingBox.style.backgroundColor="#cccccc";
lodingBox.id="lodingBox";
var imgdiv=$$("div");
var imgdiv_width="300";
var imgdiv_height="100";
var imfdiv_left=screen.width-screen.width/2-imgdiv_width/2;
//为什么要减去100px
//我也不知道为什么 因为这样算出来上边高底下低所以我就再减去100px
var imfdiv_height=screen.height-screen.height/2-imgdiv_height/2-100;
imgdiv.style.position="fixed";
imgdiv.style.left=imfdiv_left+"px";
imgdiv.style.top=imfdiv_height+"px";
imgdiv.style.width=imgdiv_width+"px";
imgdiv.style.height=imgdiv_height+"px";
imgdiv.style.backgroundColor="red";
imgdiv.id="imgdiv";
var lodingImg=$$("img");
lodingImg.src="loadingmin.gif";
var lodingText=$$("span");
lodingText.innerHTML="正在存入数据,请稍候....";
imgdiv.appendChild(lodingImg);
imgdiv.appendChild(lodingText);
$("gn").appendChild(lodingBox);
$("gn").appendChild(imgdiv);
var temp=1;
zheli(10);
//$("lodingBox").style.display="none";
//$("imgdiv").style.display="none";
function zheli(n){
if(n==1)
{
return temp;
}
temp=temp*n;
//lodingText.innerHTML+="正在存入数据,请稍候....<br />"+temp+"<br />";
//document.write(temp+"<br />");
zheli(n-1);
}
</script>
在ie8里边怎么postion没有起到效果是怎么回事
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
在前边加上这个就正确了
是4.0的改成1.0就成
ie8是4.0.1的不支持fixed