请大家看看下面js这段代码,为什么在IE下弹出的提示框格式正确,而在FIRE FOX下就出现大片的黑屏呢?谢谢
functionshowWindow(id,div_width,div_height){vartop_height=(document.documentElement.c...
function showWindow(id,div_width,div_height){
var top_height =(document.documentElement.clientHeight-200)/2;
top_height += document.documentElement.scrollTop;
location.href="#floatwin";
var width = div_width;
var height = div_height;
var windowstr= document.getElementById(id).innerHTML;
document.getElementById("infoDiv").innerHTML=windowstr;
document.getElementById("infoDiv").style.left=((document.body.clientWidth-width)>0?(document.body.clientWidth-width):0)/2+"px";
document.getElementById("infoDiv").style.top= top_height +"px";
document.getElementById("infoDiv").style.zIndex=10001;
document.getElementById("infoDiv").style.width=width;
document.getElementById("infoDiv").style.height=height;
document.getElementById("infoDiv").style.border="3px solid #0099ff";
document.getElementById("tranDiv").style.height=document.body.clientHeight+ "px";
document.getElementById("tranDiv").style.width=document.body.clientWidth+ "px";
document.getElementById("tranDiv").style.display="";
document.getElementById("tranDivBack").style.display="";
document.getElementById("tranDivBack").style.zIndex=10000;
document.getElementById("infoDiv").style.display="";
}
在FIREFOX里面能显示,这是格式大不相同,和在IE里面的格式差狠多 展开
var top_height =(document.documentElement.clientHeight-200)/2;
top_height += document.documentElement.scrollTop;
location.href="#floatwin";
var width = div_width;
var height = div_height;
var windowstr= document.getElementById(id).innerHTML;
document.getElementById("infoDiv").innerHTML=windowstr;
document.getElementById("infoDiv").style.left=((document.body.clientWidth-width)>0?(document.body.clientWidth-width):0)/2+"px";
document.getElementById("infoDiv").style.top= top_height +"px";
document.getElementById("infoDiv").style.zIndex=10001;
document.getElementById("infoDiv").style.width=width;
document.getElementById("infoDiv").style.height=height;
document.getElementById("infoDiv").style.border="3px solid #0099ff";
document.getElementById("tranDiv").style.height=document.body.clientHeight+ "px";
document.getElementById("tranDiv").style.width=document.body.clientWidth+ "px";
document.getElementById("tranDiv").style.display="";
document.getElementById("tranDivBack").style.display="";
document.getElementById("tranDivBack").style.zIndex=10000;
document.getElementById("infoDiv").style.display="";
}
在FIREFOX里面能显示,这是格式大不相同,和在IE里面的格式差狠多 展开
3个回答
展开全部
var a=document.getElementById(".....")
a.innerHTML="....."
这样试试
a.innerHTML="....."
这样试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我测试了下,没有问题啊,你看看firebug里面哪里有错
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询