Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable right-click menu

Status
Not open for further replies.

snoopy75

Technical User
Aug 24, 2001
340
0
0
US
First of all, I'm not asking this question to protect my code or anything, because I've read the numerous threads on that subject, and I know that's not possible.

I'm trying to design a custom right-click menu for certain links on my page. I found a neat tool tip script on , and I want to modify it to bring up a tool tip when the user right-clicks on a link (instead of onMouseOver). However, at the same time, I'd like to suppress the standard right-click menu, to avoid confusion. I've looked, but I can't seem to find the code snippet that should make that possible. Can anyone give me a hand? Thanks!

--Ryan
 
Hi-

Use code below gently provided by (
<html>
<head>

<script type=&quot;text/javascript&quot;>
function whichButton()
{
if (event.button==1)
{
alert(&quot;Left mouse button was clicked!&quot;)
}
else
{
alert(&quot;Right mouse button was clicked!&quot;)
}
}
</script>
</head>

<body onmousedown=&quot;whichButton()&quot;>

<p>
Click somewhere in the document. An alert box will alert which mouse button you clicked.
</p>

</body>
</html>


Ciao
Placido


Placido

P.S.
Knowledge gives you the mean to see the door...
Wisdom gives you the key to open it...
 
I forgot... that i sonly for IE5.5 and above

Ciao
Placido

Placido

P.S.
Knowledge gives you the mean to see the door...
Wisdom gives you the key to open it...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top