DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> 屏蔽F1~F12的快捷鍵的js函數
屏蔽F1~F12的快捷鍵的js函數
編輯:關於JavaScript     
復制代碼 代碼如下:
function window.onhelp(){return false} //屏蔽F1幫助
/*keyCod從113-123分別禁用了F2-F12鍵,13禁用了回車鍵(Enter),8禁用了退格鍵(BackSpace)*/

document.onkeydown = function(){
if(window.event && window.event.keyCode == 113) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 114) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 115) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 116) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 117) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 118) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 119) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 120) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 121) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 122) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 123) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 13) {
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 8) {
alert(str+"\n請使用Del鍵進行字符的刪除操作!");
window.event.returnValue=false;
}
if(window.event && window.event.keyCode == 505){
  alert(str)
window.event.returnValue=false;
}
}
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved