怎样屏蔽鼠标右键?
如题,求给出代码. 问题点数:80、回复次数:5Top
1 楼huangguolinc(来了)回复于 2005-06-03 13:09:48 得分 10
function rightClick()
{
//你的程序
return false;
}
document.oncontextmenu = rightClick;Top
2 楼LaoDai_Net(『老代』)回复于 2005-06-03 13:11:28 得分 10
<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 bgcolor="#000000" text="#666666" onkeydown="onKeyDown()" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" >
<p></p>
<p>< /p>
<p></p>
</body>
Top
3 楼czsxj(知道一点)回复于 2005-06-03 13:11:36 得分 10
<scrupt>
function drag()
{return false;}
document.ondragstart=drag
function stopmouse(e)
{
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
return false;
else if
(navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
alert("不得使用右键! :)");
return false;
}
return true;
}
document.onmousedown=stopmouse;
if (document.layers)
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=stopmouse;
</SCRIPT>Top
4 楼hchxxzx(NET?摸到一点门槛)回复于 2005-06-03 13:13:29 得分 30
<body oncontextmenu='window.event.returnValue=false'>Top
5 楼wangxinghai(我本轻狂)回复于 2005-06-03 13:16:17 得分 20
<body onContexMenu="return false" onSelectStart="return false">Top




