<div class="codetitle"> <span><a style="CURSOR: pointer" data="70994" class="copybut" id="copybut70994" onclick="doCopy('code70994')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code70994"> <br><script language="Javascript" type="text/javascript"> <BR>//屏蔽滑鼠右鍵、Ctrl N、Shift F10、F11、F5刷新、退格鍵<BR>function document.oncontextmenu() { <BR>event.returnValue = false; <BR>} //屏蔽滑鼠右鍵<BR>function window.onhelp() { <BR>return false <BR>} //屏蔽F1幫助<BR>function document.onkeydown() { <BR>if ((window.event.alt) & & ((Key) &Key) & ((Key) &Key) & window.event.keyCode == 37) || //屏蔽Alt 方向鍵← <BR>(window.event.keyCode == 39))) //屏蔽Alt 方向鍵→ <BR>{ <BR>alert("不准你使用ALT 方向鍵前進或後退網頁!方向鍵彈出警告框時,按住Alt 鍵不放, <BR>用滑鼠點掉警告框,這種屏蔽方法就失效了。以後若 <BR>有哪位高手有真正屏蔽 Alt 鍵的方法,請告知。 */ <BR><BR>if ((event.keyCode == 8) || //屏蔽退格刪除鍵<BR>(event.keyCode == 116) || //屏蔽F5 刷新鍵<BR>( event.ctrlKey && event.keyCode == 82)) { //Ctrl R <br>event.keyCode = 0; <br>event.returnValue = false; <BR>} <BR>if (event.keyCode == 122 ) { <BR>event.keyCode = 0; <BR>event.returnValue = false; <BR>} <BR>//屏蔽F11 <BR>if (event.ctrlKey && event.keyCode == 78) event.returnValue = false; <BR>//屏蔽Ctrl n <BR>if (event.shiftKey && event.keyCode == 121) event.returnValue = false; <BR>//屏蔽shift F10 <BR>if (window.event. srcElement.tagName == "A" && window.event.shiftKey) <BR>window.event.returnValue = false; //屏蔽shift 加滑鼠左鍵新開一網頁<BR>if ((window.event.altKey) && (window.event.keyCode == 115)) //屏蔽Alt F4 <BR>{ <BR>window.showModelessDialog("about:blank", "", "dialogWidth:1px;dialogheight:1px"); <BR>return false; <BR>} <BR>} <BR></script> <br><br> </div>