- 制作方法:
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>禁止鼠标右键</title>
- </head>
- <script>
- function onKeyDown()
- {
- if ((event.keyCode==116)||(window.event.ctrlKey)||(window.event.shiftKey)||(event.keyCode==122))
- {
- event.keyCode=0;
- event.returnValue=false;
- }
- }
- </script>
- <script>
- function yxl() {
- if(window.event.altKey)
- {
- window.event.returnValue=false;
- }
- }
- document.onkeydown=yxl
- </script>
- <body onkeydown="onKeyDown()" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" >
- <p>右键不管用了呢?http://www.codefans.net ,你鼠标坏了吧?</p>
- </body>
- </html>
一个禁止鼠标右键菜单的脚本,并少了提示警告! .
最新推荐文章于 2013-09-10 13:22:17 发布