1.

Solve : onRightClick??

Answer»

Is there a JavaScript for when a user right-clicks an image?There isn't a right-click event as such, because this is so OS-dependent.  But you will find >this< tutorial helpful.  Note that many browsers make it possible to disable any code that alters the context menu.  I have this function switched on, in my browser.This script will give an error if you USE right click. Works in IE, FIREFOX, but i don't know about opera or netscape.
You still need to put the JS tags, but i wasnt able to post it whit the tags

Code: [Select]<!--
var message="YOUR ERROR SCRIPT COMES HERE";

function clickIE4(){
if (event.button==2){
ALERT(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
 
i also have a script that blocks rightclick, but that doesnt give an error.
you just can't use your right click.

if you want it, YUST mail me  That works in everything but Opera. Cool I don't have opera or netscape, so if i make a script, i don't know if it works in netscape or opera, but thx for the info anyway. You can download both:

http://www.opera.com/

http://www.netscape.com/



Discussion

No Comment Found