弹出小页面/对话框,锁定主页面的JS脚本
2009-09-07 18:32
465 查看
弹出小页面/对话框,锁定主页面的JS脚本
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
<script language="JavaScript">
<!--
var lwindow;
function LockWindow() {
var div = document.createElement("DIV");
div.id = "MzLockWindow_" + "_" + new Date().getTime();
with (div.style) {
zIndex = 10000;
top = "0px";
left = "0px";
width = "100%";
height = "100%";
border = "none";
margin = padding = 0;
position = "absolute";
backgroundImage = "url(/d.gif)";
filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60)";
backgroundColor = "";
}
document.body.insertBefore(div, document.body.firstChild);
document.getElementById("Layer1").style.visibility = "visible";
return div;
}
function UnlockWindow(obj) {
if (obj) {
document.body.removeChild(obj);
document.getElementById("Layer1").style.visibility = "hidden";
}
}
</script>
</head>
<body >
<form name="form1" method="post" action="">
<table width="200" border="1" align="center" style="vertical-align:middle ">
<tr>
<td>aa</td>
<td>bb</td>
<td>v</td>
</tr>
<tr>
<td>sd</td>
<td>f</td>
<td>d</td>
</tr>
<tr>
<td>dfsd</td>
<td>s</td>
<td>sdf</td>
</tr>
</table>
<div id="Layer1"
style="position: absolute; width: 300px; height: 120px; z-index: 10001; left: expression((body.clientWidth-300)/2);
top: 100px;layer-background-color: red; white; border: 15px none blue;
background-image:url(statusbar.gif);background-repeat:no-repeat ;background-positionX:center;background-positionY:center;background-position:center; visibility: hidden;">
<input type="button" name="Submit" value="解锁"
onClick="UnlockWindow(lwindow);">
</div>
<input type="button" name="Submit" value="锁定"
onClick="lwindow=LockWindow();">
</p>
</form>
</body>
</html>
这段代码是根据网上某位大虾的脚本简化的,用来锁页面的,用得时候将Layer1中的背景图片改下
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
<script language="JavaScript">
<!--
var lwindow;
function LockWindow() {
var div = document.createElement("DIV");
div.id = "MzLockWindow_" + "_" + new Date().getTime();
with (div.style) {
zIndex = 10000;
top = "0px";
left = "0px";
width = "100%";
height = "100%";
border = "none";
margin = padding = 0;
position = "absolute";
backgroundImage = "url(/d.gif)";
filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60)";
backgroundColor = "";
}
document.body.insertBefore(div, document.body.firstChild);
document.getElementById("Layer1").style.visibility = "visible";
return div;
}
function UnlockWindow(obj) {
if (obj) {
document.body.removeChild(obj);
document.getElementById("Layer1").style.visibility = "hidden";
}
}
</script>
</head>
<body >
<form name="form1" method="post" action="">
<table width="200" border="1" align="center" style="vertical-align:middle ">
<tr>
<td>aa</td>
<td>bb</td>
<td>v</td>
</tr>
<tr>
<td>sd</td>
<td>f</td>
<td>d</td>
</tr>
<tr>
<td>dfsd</td>
<td>s</td>
<td>sdf</td>
</tr>
</table>
<div id="Layer1"
style="position: absolute; width: 300px; height: 120px; z-index: 10001; left: expression((body.clientWidth-300)/2);
top: 100px;layer-background-color: red; white; border: 15px none blue;
background-image:url(statusbar.gif);background-repeat:no-repeat ;background-positionX:center;background-positionY:center;background-position:center; visibility: hidden;">
<input type="button" name="Submit" value="解锁"
onClick="UnlockWindow(lwindow);">
</div>
<input type="button" name="Submit" value="锁定"
onClick="lwindow=LockWindow();">
</p>
</form>
</body>
</html>
这段代码是根据网上某位大虾的脚本简化的,用来锁页面的,用得时候将Layer1中的背景图片改下
相关文章推荐
- 禁止iframe页面的所有js脚本如alert及弹出窗口
- DIY的JS弹出层弹出对话框弹出页面弹出窗口的插件
- 页面DIV弹出层 JS原生脚本
- js实现跨窗体屏幕锁定并弹出对话框
- jsp页面不乱码,外部引用的js弹出对话框乱码
- 【转】用JS实现弹出模式对话框,实现页面传值
- 使用div和js脚本弹出对话框
- js将页面table导出excel,弹出保存对话框
- JS中弹出确定和取消对话框并跳转页面
- JS弹出框、对话框、提示框,JS关闭窗口、关闭页面和JS控制页面跳转
- 在JS中控制从本页面经过action弹出一个对话框
- js脚本弹出模式查询页面
- html 锁定页面(js遮罩层弹出div效果)
- 注入脚本的方式弹出提示对话框(ShowMessageBox)并且定位跳转页面
- 结合jQuery的unload方法实现JS退出页面弹出对话框
- 禁止iframe页面的所有js脚本如alert及弹出窗口等
- html 锁定页面(js遮罩层弹出div效果)
- 禁止iframe页面的所有js脚本如alert及弹出窗口等
- 在页面加载page_load时,弹出一个js对话框:欢迎光临!
- aspx.cs 中写JS弹出脚本,导致破坏页面结构,页面变形(解决办法)