[js]js鼠标右键禁用

 

<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>右键不管用了呢?你鼠标坏了吧?</p>
</body>
</html>

 

posted @ 2015-01-03 19:55  snow__wolf  阅读(180)  评论(0)    收藏  举报