弹出层时使弹出层的页面不能进行操作的实现(模态窗体)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>
<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>
相关文章推荐
- 弹出层时使弹出层的页面不能进行操作的实现(模态窗体)1
- 弹出层时使弹出层的页面不能进行操作的实现
- Java实现点击按钮弹出新窗体的功能实现,旧窗体不进行操作
- 1怎样让输入的text文本填写的部分只添加数字、2怎样将输入的数字一次性全部删除 3怎样选择密码 让它不显示 4 怎样实现在没有return的情况下点击button的情况下就能够使键盘页面下落5 怎样实现点击指定的button来对使指定的text进行键盘弹出 6怎样改变button按钮的状态
- [Selenium]通过Selenium实现在当前浏览器窗口点击一个图标之后,弹出另外一个窗口,关闭这个窗口,再回到原来的窗口进行操作
- Jquery实现遮罩层的简单实例(就是弹出DIV周围都灰色不能操作)
- js实现弹出窗口、页面变成灰色并不可操作的例子分享
- Jquery实现遮罩层,就是弹出DIV周围都灰色不能操作
- js解决弹出摸态框时不能点击页面其他部分,只能操作摸态框
- Asp.net MVC利用Ajax.BeginForm实现bootstrap模态框弹出,并进行前段验证
- 实现弹出"提示对话框"之后再进行"页面的转向"
- 实现移动端弹出层弹出的时候页面不能滑动,关闭弹出层时页面恢复滑动
- 表中多个按钮进行操作不需要跳转页面的实现
- 实现功能:弹出一个DIV层提示等待信息,这个时候禁用用户操作页面中的其他内容
- 弹出新页面,操作后自己关闭并使父窗体跳转到相应界面
- JavaScript:用JS实现加载页面前弹出模态框
- JS弹出模式提示窗体,实现页面其他地方不可编辑效果
- (精)在ASP.NET中使用IFRAME+DIV,可以实现在同一页面使用弹出(模态)窗口
- asp.net 页面弹出层,背景变灰不能操作
- Android编程实现长按弹出选项框View进行操作的方法