如题,本人用js+div弹出层,利用filter.alpha(opacity=50)(IE)、filter.alpha(opacity=0.5)(非IE)使弹出层后背景半透明,并且div层中的控件会执行后台的函数,但我已经用ajax对这个div中的事件进行局部刷新,现在的情况是IE下这个网页是正常的,但在非IE时最开始会弹出层,但在点击执行了后台数据之后,div就不显示了,但背景还是半透明!附上本人js代码:function opendiv(){
var IE = navigator.userAgent.indexOf("MSIE")>0? 1: 0;
var obj = document.getElementById("query");
var div=document.getElementById("div1");
if(IE)
{
document.getElementById("div1").style.filter = "alpha(opacity=50)";
div.style.display="block";
obj.style.display="block";
}
else
{
document.getElementById("div1").style.opacity = "0.5";
div.style.display="table-row";
obj.style.display="table-row";
}
div.style.position = "absolute";
div.style.zIndex = "1000";
div.style.height = "100%";
div.style.width = "100%";
div.style.background="#000000";
obj.style.position = "absolute";
obj.style.zIndex = "9999";
obj.style.width = "600px";
obj.style.height = "500px";
obj.style.backgroundImage="url(images/back.gif)";
obj.style.left =(document.documentElement.clientWidth -600) / 2 + "px";
obj.style.top =(document.documentElement.clientHeight-480) / 2 + "px";
}
var IE = navigator.userAgent.indexOf("MSIE")>0? 1: 0;
var obj = document.getElementById("query");
var div=document.getElementById("div1");
if(IE)
{
document.getElementById("div1").style.filter = "alpha(opacity=50)";
div.style.display="block";
obj.style.display="block";
}
else
{
document.getElementById("div1").style.opacity = "0.5";
div.style.display="table-row";
obj.style.display="table-row";
}
div.style.position = "absolute";
div.style.zIndex = "1000";
div.style.height = "100%";
div.style.width = "100%";
div.style.background="#000000";
obj.style.position = "absolute";
obj.style.zIndex = "9999";
obj.style.width = "600px";
obj.style.height = "500px";
obj.style.backgroundImage="url(images/back.gif)";
obj.style.left =(document.documentElement.clientWidth -600) / 2 + "px";
obj.style.top =(document.documentElement.clientHeight-480) / 2 + "px";
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货