Link to home
Start Free TrialLog in
Avatar of lakeryu
lakeryu

asked on

How can I let the href have no popmenu?

In one page, I want let the hyperlink have no the popmenu,  when I right click it? and how can I change the popmenu dynamic?

wait for your answer!thanks!
Avatar of hexagon47
hexagon47

function avoidRightClick()
{
     if (event.button==2||event.button==3)
     {
     alert('no right button allowed');
     return false;
     }
}
document.onmousedown=avoidRightClick;

this should do it for what concerns the menu not to appear when you right click (obviously customise it where I have put the alert()).
Re the second questions, you mean that in certain pages you want a custom menu to appear instead of the normal one when you right click on a link?
Avatar of lakeryu

ASKER

Thank you for your answer! Your method is right, But I don't want popup anythig include the warning message box.

the second questions, what you say is right. I want a custom menu to appear instead of the normal one when I right click on a link!

thanks!
ASKER CERTIFIED SOLUTION
Avatar of hexagon47
hexagon47

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lakeryu

ASKER

Thanks very much!
now it worked correctly!