PDA

View Full Version : Rigth Mouse



Garadon
Nov 30th, 2002, 11:19 PM
Can any1 tell me of a simple and good script that disables rigth mouse click in the entire document?

p.s this is not for copy protection I just want to use rigth mouse click for something else :D

x_goose_x
Nov 30th, 2002, 11:57 PM
http://developer.irt.org/script/969.htm

linuxdude
Dec 1st, 2002, 12:15 AM
<script language=JavaScript>
function clickIE() {
if (document.all) {
return false;
}
}
function clickNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
}
else{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
</script>

I got this from http://www.a1javascripts.com

KaoS
Dec 1st, 2002, 04:56 AM
ive been needing help w/ this to, that script works great but how would u add a pop up alert w/ a custom message on right click???

Jeepers
Dec 1st, 2002, 01:13 PM
Originally posted by Garadon

p.s this is not for copy protection

As the only purpose of restricting the use of a right click is to stop users accessing the menu that contains view source, amongst other things, and all of which are available on other menus, I can't see for what other purpose it is for?? :confused: