Click to See Complete Forum and Search --> : oncontextmenu in different browsers


michelle
03-20-2003, 05:10 AM
I want to get this code working with Opera, but it seems like it is a IE-function. Any code for NS is also appreciated.


function alerta() {
alert("khgk");
}

<body oncontextmenu="alerta();return false">

Here is Microsofts documentation on this behaviour:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/oncontextmenu.asp

Any thoughts?
// Michelle

gil davis
03-20-2003, 06:22 AM
From the page in your post:
Standards Information
There is no public standard that applies to this event.That means it is an IE-only thing.

pyro
03-20-2003, 06:56 AM
You could take a look at this script, for a cross browser way to do it: http://www.dynamicdrive.com/dynamicindex9/noright.htm

michelle
03-20-2003, 08:30 AM
> You could take a look at this script,
> for a cross browser way to do it

This script does not work with Opera, so not really a cross-browser script...

oncontextmenu works partly with NS6, ie if the function does something other than merely alert(), the NS-right-click menu will still appear...

Anyone who knows if Opera supports any behaviour like this?

// Michelle