Standards-following browsers accept the event object as the first argument to the event handling function.
To make this cross-browser, you handle the event like this:
Code:
function($e)
{
// If $e evaluates to false, assign it window.event.
($e = ($e || window.event));
}
If you want to cancel a right click, just do this
Code:
document.oncontextmenu = function($e)
{
if (window.event)
{
window.event.returnValue = false;
}
else
{
$e.preventDefault();
}
};
Opera does not support the "oncontextmenu" event.
HTH!
Regards,
Rich
--
[
http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design