实现确认按钮出现遮蔽网页其他内容,捕获传统保存快捷组合键

当用户按下某按钮后,使网页其他部分内容和按钮被遮蔽不可用

另外,捕捉传统的ctrl+s按钮快捷键

以下是部分代码,未进行其他处理.

<%@ Page language="c#" Codebehind="Moengban.aspx.cs" AutoEventWireup="false" Inherits="test.Moengban" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
         <HEAD>
                   <title>Moengban</title>
                   <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
                   <meta name="CODE_LANGUAGE" Content="C#">
                   <meta name="vs_defaultClientScript" content="JavaScript">
                   <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
         </HEAD>
         <body>
                   <form id="Form1" method="post">
                   Some Page Content
                   <input type="submit" value="Submit button" onclick="return Msg()">
                            <div id="msg" style="display:none;left:0;top:0;width:102%;height:100%;BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; Z-INDEX: 99; FILTER: alpha(opacity=80); BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff"></div>
                   </form>
         </body>
         <script language=javascript>
<!--
 
var prekey=-1;
 
document.body.onkeydown=save;
document.body.onkeyup=relase;
 
function Msg()
{
         var user;
         document.all.msg.style.display="";
         user=confirm('is ok?');
         document.all.msg.style.display="none";
        
         return user;
}
 
function save()
{
         if(prekey==17&&event.keyCode==83)
         alert("save");
 
         prekey=event.keyCode;
}
 
function relase()
{
         prekey=-1;
}
//-->
</script>
</HTML>窗体顶端
 
 
posted @ 2006-10-30 17:25  ZetaChow晓代码  阅读(160)  评论(0编辑  收藏  举报