...

View Full Version : disbale right click for specific links?



agravayne
09-09-2008, 11:06 AM
Hello All,

I am trying to disable right click only for specific links on the page> I want to create my own pop up menu for these eventually. At present I have the following


<a href='#' onContextMenu="typesclick()">Types</a>

the function is


function typesclick()
{

alert("testing");
return false;


}

The alert appears but the browser context menu also appears. I am using ie7? Any ideas why this is not working?

Scott Bailey

Philip M
09-09-2008, 11:32 AM
See FAQ No.13.

"Please note that "No Right Click" scripts (one of the favorite uses of javascript to "protect" a web page) are considered at best a "waste of time" but more often as "user antagonistic" by most of the regulars here."

You cannot suppress the browser context menu in IE7 - this is a security feature set by the user.

Kor
09-09-2008, 12:13 PM
Leave the right click functionality as it is. As a user I would be annoyed if you will change my mouse's right click functions, so that either I will quit your page and never come back or I will disable javascript to avoid that unpleasent change.

Use the left click (or mouseover) for contextual menus.

joey,choey
09-09-2008, 03:05 PM
put a quick password protect script on the pages you dont want people seeing or uhh "clicking" lol.

or redirect script
or a tooltip saying "under-construction"

or just simply make the link say
<a>Types</a> with no link in it
....and change it back until you're done :) there, we all happy :p

you can even combine these :D xD

there's lots more you can do lol



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum