发布网友 发布时间:2024-10-24 00:28
共1个回答
热心网友 时间:2024-11-14 21:45
<script>
if (window.Event) document.captureEvents(Event.MOUSEUP); function nocontextmenu() {
event.cancelBubble = true
event.returnValue = false;
return false;
}
if (window.Event) document.captureEvents(Event.MOUSEUP);
function c() {
if (event.button == 1)
{
alert("你好");
return false;
}
else
{
alert("对不起");
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.onmousedown = c;
document.oncontextmenu = nocontextmenu;
</script>