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

在该页面上,点击“回复”会弹出一个没有标题栏和关闭按扭的自定义的页面!但是弹出层的同时层下面的页面好象都被锁死了。如果弹出的页面不关闭的话将无法操作层下面的页面。只有关闭了弹出的层以后才能再次操作.
   实现以上操作的例子!

<html>
<head>
</head>
<body>
<p align="center">
<script>
function locking(){
 document.all.ly.style.display="block";
 document.all.ly.style.width=document.body.clientWidth;
 document.all.ly.style.height=document.body.clientHeight;
document.all.Layer2.style.display='block';
}
function Lock_CheckForm(theForm){
 if(theForm.P_USERPASS.value==''){alert("错误:请输入你的用户密码!");theForm.P_USERPASS.focus();return false;}
 if(theForm.P_USERPASS.value !='123'){alert("错误:密码错误!");theForm.P_USERPASS.value='';theForm.P_USERPASS.focus();return false;}
 else{
  document.all.ly.style.display='none';document.all.Layer2.style.display='none';
  }
 return false;
}
function closeW()
{
   document.all.ly.style.display='none';document.all.Layer2.style.display='none';
   return false;
}
</script>
</p>
<p align="center">

<INPUT TYPE="button" value="显示层" οnclick="locking()">
</p>
<div id="ly" style="position:absolute;top:0px;FILTER: alpha(opacity=60);background-color:#777; z-index:2; left: 0px;display:none;"> </div>

<!--    浮层框架开始    -->
      <div id="Layer2" align="center" style="position:absolute; z-index:3; width: 540; height:170px;left:expression((document.body.offsetWidth-540)/2); top: expression((document.body.offsetHeight-170)/2);background-color:#fff;display:none;" valign="center">
<form method="POST" action="" οnsubmit="return Lock_CheckForm(this);">
   <TABLE width=540 height=170 border=0 cellpadding=0 cellspacing=0 style="border:0 solid #e7e3e7;border-collapse: collapse">
   <TR>
    <TD style="background-color:#73A2d6;color:#fff;padding-left:4px;padding-top:2px;font-weight:bold;font-size:14px;" height=27 valign="center">[&nbsp;警&nbsp;告&nbsp;]</TD>
   </TR>
   <TR>
    <TD align="center" valign="center">请输入解除锁定密码<p><input type="text" name="P_USERPASS" size="20"></TD>
   </TR>
   <TR>
    <TD height=30 align="center"><INPUT type="submit" value="  确    定  ">&nbsp;<INPUT type="button" value="  关    闭  " οnclick=" return closeW();"></TD>
   </TR>
   </TABLE>
</form>
      </div>
<!--    浮层框架结束    -->
</body>
</html>

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值