本段js需要引入jquery,请自行引入吧!

我测试的时候用的jquery2.1.4!

<script type="text/javascript">
    $(document).ready(function(){ //jQuery 屏蔽右键 
    $(document).bind("contextmenu",function(e){return false;});});
    $(document).ready(function() { //jQuery 屏蔽F5
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==116){e.keyCode = 0;return  false;} }); }); 
    $(document).ready(function() { //jQuery 屏蔽F7 
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==118){e.keyCode = 0;return  false;} }); });
    $(document).ready(function() { //jQuery 屏蔽F11 
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==122){e.keyCode = 0;return  false;} }); });
    $(document).ready(function() { //jQuery 屏蔽F12 
    $(document).bind("keydown",function(e){e=window.event||e; if(e.keyCode==123){e.keyCode = 0;return  false;} }); });
</script>
Last modification:March 12th, 2019 at 08:38 pm
如果觉得这篇技术文章对你有用,请随意赞赏