62,041
社区成员
发帖
与我相关
我的任务
分享
// JScript 文件
function ShowDialog(nWidth, nHeight, strUrl, strTitleName)
{
var mydiv=document.getElementById("fcolor");
var nHeight=nHeight;
var scolor=getCurrentStyle(mydiv, "backgroundColor", "background-color");
/*ie6*/
if(scolor=="#0000ff")
{
nHeight=nHeight-10;
}/*ie7*/
else if(scolor=="#ff0000")
{
nHeight=nHeight+10;
document.getElementById("iframeDialog").style.height = nHeight-21+"px";
}/*firefox*/
else if(scolor=="rgb(0, 255, 0)")
{
nHeight=nHeight+10;
document.getElementById("iframeDialog").style.height = nHeight-21+"px";
}
else
{
nHeight=nHeight+10;
document.getElementById("iframeDialog").style.height = nHeight-21+"px";
}
document.getElementById("divDialog").style.display = "block";
document.getElementById("divDialog").style.visibility = "visible";
document.getElementById("divDialog").style.top = (window.screen.height/2-nHeight/2)/2-23+"px";
document.getElementById("divDialog").style.left = (window.screen.width/2-nWidth/2)+"px";
document.getElementById("divDialog").style.width = nWidth+"px";
document.getElementById("divDialog").style.height = nHeight+"px";
var fid=document.getElementById("hfActiveWin").value;
var num=Math.round(Math.random()*10000);
if(strUrl.indexOf('?')!=-1){strUrl+="&a="+num+"&fid="+fid}else{strUrl+="?a="+num+"&fid="+fid;}
document.getElementById("iframeDialog").src = strUrl;
document.getElementById("divTitleName").innerHTML = strTitleName;
document.getElementById("divTitleName").style.width = nWidth-50+"px";
document.getElementById("divBackground").style.width = "100%";
document.getElementById("divBackground").style.height = "100%";
document.getElementById("divBackground").style.display = "block";
document.getElementById("divBackground").style.visibility = "visible";
document.getElementById("divBackground").style.top = "0px";
document.getElementById("divBackground").style.left = "0px";
Sethidden1();
}
其次,窗体上弹出窗体:如下
[code=JScript]
function ShowDialog1(nWidth, nHeight, strUrl, strTitleName)
{
var mydiv=document.getElementById("fcolor");
var nHeight=nHeight;
var scolor=getCurrentStyle(mydiv, "backgroundColor", "background-color");
/*ie6*/
if(scolor=="#0000ff")
{
nHeight=nHeight-10;
}/*ie7*/
else if(scolor=="#ff0000")
{
nHeight=nHeight+10;
document.getElementById("iframeDialog1").style.height = nHeight-21+"px";
}/*firefox*/
else if(scolor=="rgb(0, 255, 0)")
{
nHeight=nHeight+10;
document.getElementById("iframeDialog1").style.height = nHeight-21+"px";
}else
{
nHeight=nHeight+10;
document.getElementById("iframeDialog1").style.height = nHeight-21+"px";
}
document.getElementById("divDialog1").style.display = "block";
document.getElementById("divDialog1").style.visibility = "visible";
document.getElementById("divDialog1").style.top = (window.screen.height/2-nHeight/2)/2-23+"px";
document.getElementById("divDialog1").style.left = (window.screen.width/2-nWidth/2)+"px";
document.getElementById("divDialog1").style.width = nWidth+"px";
document.getElementById("divDialog1").style.height = nHeight+"px";
var num=Math.round(Math.random()*10000);
if(strUrl.indexOf('?')!=-1){strUrl+="&a="+num}else{strUrl+="?a="+num;}
document.getElementById("iframeDialog1").src="about:blank";
document.getElementById("iframeDialog1").src = strUrl;
document.getElementById("divTitleName1").innerHTML = strTitleName;
document.getElementById("divTitleName1").style.width = nWidth-50+"px";
document.getElementById("divBackground1").style.width = "100%";
document.getElementById("divBackground1").style.height = "100%";
document.getElementById("divBackground1").style.display = "block";
document.getElementById("divBackground1").style.visibility = "visible";
document.getElementById("divBackground1").style.top = "0px";
document.getElementById("divBackground1").style.left = "0px";
}