您的位置:首页 > 其它

弹出层时使弹出层的页面不能进行操作的实现(模态窗体)2

2006-12-04 09:49 591 查看
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>大家小心啊</title>
<script>
var t_DiglogX,t_DiglogY,t_DiglogW,t_DiglogH;

function gid(id) {
return document.getElementById?document.getElementById(id):null;
}

function gname(name) {
return document.getElementsByTagName?document.getElementsByTagName(name):new Array()
}

function Browser() {
var ua, s, i;
this.isIE = false;
this.isNS = false;
this.isOP = false;
this.isSF = false;
ua = navigator.userAgent.toLowerCase();
s = "opera";
if ((i = ua.indexOf(s)) >= 0) {
this.isOP = true;return;
}
s = "msie";
if ((i = ua.indexOf(s)) >= 0) {
this.isIE = true;return;
}
s = "netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;return;
}
s = "gecko";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;return;
}
s = "safari";
if ((i = ua.indexOf(s)) >= 0) {
this.isSF = true;return;
}
}

function DialogLoc() {
var dde = document.documentElement;
if (window.innerWidth) {
var ww = window.innerWidth;
var wh = window.innerHeight;
var bgX = window.pageXOffset;
var bgY = window.pageYOffset;
} else {
var ww = dde.offsetWidth;
var wh = dde.offsetHeight;
var bgX = dde.scrollLeft;
var bgY = dde.scrollTop;
}
t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
}

function DialogShow(showdata,ow,oh,w,h) {
var objDialog = document.getElementById("DialogMove");
if (!objDialog) objDialog = document.createElement("div");
t_DiglogW = ow;
t_DiglogH = oh;
DialogLoc();
objDialog.id = "DialogMove";
var oS = objDialog.style;
oS.display = "block";
oS.top = t_DiglogY + "px";
oS.left = t_DiglogX + "px";
oS.margin = "0px";
oS.padding = "0px";
oS.width = w + "px";
oS.height = h + "px";
oS.position = "absolute";
oS.zIndex = "5";
oS.background = "#FFF";
oS.border = "solid #000 3px";
objDialog.innerHTML = showdata;
document.body.appendChild(objDialog);
}

function DialogHide() {
ScreenClean();
var objDialog = document.getElementById("DialogMove");
if (objDialog) objDialog.style.display = "none";
}

function ScreenConvert() {
var browser = new Browser();
var objScreen = gid("ScreenOver");
if (!objScreen) var objScreen = document.createElement("div");
var oS = objScreen.style;
objScreen.id = "ScreenOver";
oS.display = "block";
oS.top = oS.left = oS.margin = oS.padding = "0px";
if (document.body.clientHeight) {
var wh = document.body.clientHeight + "px";
} else if (window.innerHeight) {
var wh = window.innerHeight + "px";
} else {
var wh = "100%";
}
oS.width = "100%";
oS.height = wh;
oS.position = "absolute";
oS.zIndex = "3";
if ((!browser.isSF) && (!browser.isOP)) {
oS.background = "#181818";
} else {
oS.background = "#F0F0F0";
}
oS.filter = "alpha(opacity=40)";
oS.opacity = 40/100;
oS.MozOpacity = 40/100;
document.body.appendChild(objScreen);
var allselect = gname("select");
for (var i=0; i<allselect.length; i++) allselect[i].style.visibility = "hidden";
}

function ScreenClean() {
var objScreen = document.getElementById("ScreenOver");
if (objScreen) objScreen.style.display = "none";
var allselect = gname("select");
for (var i=0; i<allselect.length; i++) allselect[i].style.visibility = "visible";
}

//举报
function Report(Type,ID)
{
var PostData = "do=" + Type + "&reportid=" + ID;
//PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX_Comm.aspx", PostData);
var showData = sample.innerHTML;
//ScreenConvert();DialogShow("<div id=/"DialogLoading/">正在读取,请稍候...</div>",110,10,124,20);
ScreenConvert();DialogShow(showData,400,300,420,320);

}

</script>
</head>

<body>
<DIV
class=VoteComments>大家小心啊!<BR>我在该餐厅吃了一顿让我难忘的饭。....</DIV>
<DIV class=VoteDish></DIV>
<DIV class=VoteTags></DIV>
<DIV class=TransPark></DIV>
<DIV class=VoteAction><SPAN class=TColor2>06-05-10 ԩ:48:35</SPAN>  |  <A class=BL
href="">回应</A>  |  <A
class=BL id=btnFollower1175222
onclick="this.blur();return false;"
href="#">鲜花</A>  |  <A
class=BL onclick="this.blur();Report('reportvote',1175222);return false;"
href="http://www.dianping.com/reviewlist/1/10/1#">举报</A></DIV></DIV>

<pre id=sample style="display:none">
<DIV id=DialogTitle><DIV id=DialogTitleText>举报和报错</DIV>
<DIV id=DialogTitleBtn onmouseover="var objShut = document.getElementById('DialogTitleBtn');objShut.style.border='solid 1px #000000';" onclick="return DialogHide();" onmouseout="var objShut = document.getElementById('DialogTitleBtn');objShut.style.border='solid 1px #EEE';">X</DIV>
<DIV id=DialogContent>您的姓名:  <INPUT id=ReportName maxLength=25 name=T1><BR>您的邮件:  <INPUT id=ReportEmail maxLength=50 size=25 name=T2><BR>      说明:  <TEXTAREA id=ReportComments name=S1 rows=8 cols=40></TEXTAREA></DIV>
<DIV id=DialogValidator></DIV>
<DIV id=DialogButtons><BUTTON id=ReportOK onclick="">提交</BUTTON>    <BUTTON id=ReportCancle onclick="return DialogHide();">取消</BUTTON> </DIV></DIV>
</pre>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐