首页 > 代码库 > jquery禁用右键单击功能屏蔽F5刷新

jquery禁用右键单击功能屏蔽F5刷新

1、禁用右键单击功能$(document).ready(function() {

$(document).bind("contextmenu",function(e) {

alert("sorry! No right-clicking!");

return false;

});

});

复制代码2、屏蔽F5刷新$(document).ready(function() {

$(document).bind("keydown",function(e){

e=window.event||e;

if(e.keyCode==116){

e.keyCode = 0;

return false;

}

});

});

 

jquery禁用右键单击功能屏蔽F5刷新