2个问题?
1. 我的按纽 <input id="btn_UnitSet" onclick="javascript:window.open ('UnitSet.aspx?id=<%=s_A1%>','', 'height=280, width=460, top=260, left=280, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,_blank')" type="button" value="单位设置" /> 在点击按纽后弹出UnitSet.aspx 我希望在UnitSet.aspx没关闭前,不能操作其他页面。我在UnitSet.aspx该怎么做?2.在退出页面时,我要获取退出时间来修改数据库。 我该怎么处理(哪个事件)?
1. 我的按纽 <input id="btn_UnitSet" onclick="javascript:window.open ('UnitSet.aspx?id=<%=s_A1%>','', 'height=280, width=460, top=260, left=280, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,_blank')" type="button" value="单位设置" /> 在点击按纽后弹出UnitSet.aspx 我希望在UnitSet.aspx没关闭前,不能操作其他页面。我在UnitSet.aspx该怎么做?2.在退出页面时,我要获取退出时间来修改数据库。 我该怎么处理(哪个事件)?
2.关闭就要判断很多情况,具体很多...
据说还可以用DIV模拟出来showModalDialog ,不过我也不知道怎么写
<head>
<title> Josh - Test </title>
<style type="text/css">
.opaqueLayer
{
display:none;
position:absolute;
top:0px;
left:0px;
opacity:0.6;
filter:alpha(opacity=60);
background-color: #000000;
z-Index:1000;
}
.questionLayer
{
position:absolute;
top:0px;
left:0px;
width:350px;
height:200px;
display:none;
z-Index:1001;
border:2px solid black;
background-color:#FFFFFF;
text-align:center;
vertical-align:middle;
padding:10px;
}
</style>
<script type="text/javascript">
function getBrowserHeight() {
var intH = 0;
var intW = 0;
if(typeof window.innerWidth == 'number' ) {
intH = window.innerHeight;
intW = window.innerWidth;
}
else if(document.documentElement && (document.documentElement.clientWidth ¦ ¦ document.documentElement.clientHeight)) {
intH = document.documentElement.clientHeight;
intW = document.documentElement.clientWidth;
}
else if(document.body && (document.body.clientWidth ¦ ¦ document.body.clientHeight)) {
intH = document.body.clientHeight;
intW = document.body.clientWidth;
} return { width: parseInt(intW), height: parseInt(intH) };
} function setLayerPosition() {
var shadow = document.getElementById('shadow');
var question = document.getElementById('question'); var bws = getBrowserHeight();
shadow.style.width = bws.width + 'px';
shadow.style.height = bws.height + 'px'; question.style.left = parseInt((bws.width - 350) / 2);
question.style.top = parseInt((bws.height - 200) / 2); shadow = null;
question = null;
} function showLayer() {
setLayerPosition(); var shadow = document.getElementById('shadow');
var question = document.getElementById('question');
shadow.style.display = 'block';
question.style.display = 'block'; shadow = null;
question = null;
}
function hideLayer() {
var shadow = document.getElementById('shadow');
var question = document.getElementById('question');
shadow.style.display = 'none';
question.style.display = 'none'; shadow = null;
question = null;
} window.onresize = setLayerPosition;
</script>
</head>
<body>
<div id="shadow" class="opaqueLayer"> </div>
<div id="question" class="questionLayer">
<br />
<br />
<br />
We can put anything in here
<br />
<br />
<br />
<input type="button" onclick="hideLayer();" value="Close" />
</div>
<h3> Modal Layer Test </h3>
<p> Click the image below to display the "modal" layer </p>
<img src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="Test Image" onclick="showLayer();" />
</body>
</html>
那个弹出的东西应该就是DIV做的而且关闭之前,后面的页面都不能操作另外9楼的代码报一堆JS错误
不知道怎么改