網頁中屏蔽滑鼠右鍵、Ctrl+N、Shift+F10

來源:互聯網
上載者:User
<script language="Javascript">
 //屏蔽滑鼠右鍵、Ctrl+N、Shift+F10、F5重新整理、退格鍵
 //屏蔽F1協助
function window.onhelp()
{
 return false
}
function KeyDown()
{
  //alert(event.keyCode);
 //屏蔽 Alt+ 方向鍵 ← 屏蔽 Alt+ 方向鍵 →
  if ((window.event.altKey)&&((window.event.keyCode==37)||(window.event.keyCode==39)))
  { 
     //alert("不準你使用ALT+方向鍵前進或後退網頁!");
     event.returnValue=false;
  }
  //屏蔽退格刪除鍵,屏蔽 F5 重新整理鍵,Ctrl + R
  if ((event.keyCode==116)||(event.ctrlKey && event.keyCode==82))
  {
     event.keyCode=0;
     event.returnValue=false;
  }
 
  //屏蔽 Ctrl+n
  if ((event.ctrlKey)&&(event.keyCode==78))
  { 
     event.returnValue=false;
  }
 
  //屏蔽 shift+F10
  if ((event.shiftKey)&&(event.keyCode==121))
  {
     event.returnValue=false;
  }
 
  //屏蔽 shift 加滑鼠左鍵新開一網頁
  if (window.event.srcElement.tagName == "A" && window.event.shiftKey)
  {
  window.event.returnValue = false;
  }
     
   //屏蔽Alt+F4
  if ((window.event.altKey)&&(window.event.keyCode==115))
  {
  window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
  return false;
  }
 
  //屏蔽Ctrl+A
  if((event.ctrlKey)&&(event.keyCode==65))
  {
 return false;
  }
   
}
</script>
<body onkeydown="KeyDown()" onselectstart="return false" oncontextmenu="event.returnValue=false" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="buttonface">
  <tr>
    <td>
      <table border="0" cellspacing="0" cellpadding="0">
        <tr valign="bottom">
          <td nowrap style="cursor:hand" onClick="window.external.AddFavorite('http://www.163.com', '網易163)" onMouseOver="javascript:this.className='menuMouseOver'" onMouseDown="javascript:this.className='menuMouseDown'" onMouseOut="javascript:this.className='menuMouseOut'" class="menuMouseOut">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td nowrap><img src="../../images/sunico14.gif" width="18" height="18"></td>
                <td valign="bottom" nowrap class="tdTitle">收藏&nbsp;</td>
              </tr>
            </table></td>
          <td nowrap style="cursor:hand" onClick="document.execCommand('saveAs')" onMouseOver="javascript:this.className='menuMouseOver'" onMouseDown="javascript:this.className='menuMouseDown'" onMouseOut="javascript:this.className='menuMouseOut'" class="menuMouseOut">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td nowrap><img src="../../images/sunico8.gif" width="18" height="18"></td>
                <td valign="bottom" nowrap class="tdTitle">儲存&nbsp;</td>
              </tr>
            </table></td>
          <td nowrap style="cursor:hand" onClick="document.execCommand('print')" onMouseOver="javascript:this.className='menuMouseOver'" onMouseDown="javascript:this.className='menuMouseDown'" onMouseOut="javascript:this.className='menuMouseOut'" class="menuMouseOut">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td nowrap><img src="../../images/sunico9.gif" width="18" height="18"></td>
                <td valign="bottom" nowrap class="tdTitle">列印</td>
              </tr>
            </table></td>
        </tr>
      </table></td>

 <td align="right" class="tdTitle"><a href="#" onClick="window.open('Reply_Edit.asp?Process_Type=AddNew&Article_ID=26','','scrollbar=no,top=100,left=100,width=500,height=400')">
                  <font color="#FFFF00">
                 
                  <a href="#" onClick="alert('如果您是會員請先登陸!如果不是請先註冊!/n/n著作權:163線上!');"><font color="#FFFF00">我要發表評論</font></a>
                 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.