View Single Post
Old 05-04-2001, 11:52 AM  
Expo
Registered User
 
Join Date: Apr 2001
Location: Detroit MI
Posts: 80
Quote:
Originally posted by spider1:
Anyone knows where can i find cgi script to disable right mouse click...no java scripts

thanks
Try this, this will disable EVERY FUNCTION associated with the right lick.

< !--Begin Cut-->

script
if (window.Event) // Only Netscape will have the CAPITAL E.
document.captureEvents(Event.MOUSEUP); // catch the mouse up event

function nocontextmenu() // this function only applies to IE4, ignored otherwise.
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e) // This function is used by all others
{
if (window.Event) // again, IE or NAV?
{
if (e.which == 2 &#0124;&#0124; e.which == 3)
return false;
}
else
if (event.button == 2 &#0124;&#0124; event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}

}

document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
/script
< !--End Cut-->

That is to be placed in you after your body tag.

Hope that helps. You will also have to add the "<" and the ">" arround the "script". I didn't know any other way to place the code in this post.

- Expo


[This message has been edited by Expo (edited 05-04-2001).]

[This message has been edited by Expo (edited 05-04-2001).]
Expo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote