Log in

View Full Version : Silent right click on images only



swimmyz
02-04-2009, 06:46 PM
I'm looking for a script for silent right click on images only. Can anyone help?

owt200x
02-05-2009, 07:47 AM
<img src="no-more-leeching.gif" width="250" height="250" oncontextmenu="return false;">

not to sure if the ; needs to be there

traq
02-06-2009, 01:15 AM
be advised, that only works in IE5+. To work across browsers, you'd need to use JavaScript (look here (http://www.dynamicdrive.com/dynamicindex9/index.html)), and then all someone needs to do in order to right-click anyway is disable JS in their browser.

jscheuer1
02-06-2009, 10:05 AM
Right click is already silent.

Snookerman
02-06-2009, 10:07 AM
Right click is already silent.
I think the OP means this: http://www.dynamicdrive.com/dynamicindex9/noright3.htm (http://www.dynamicdrive.com/dynamicindex9/noright3.htm)

jscheuer1
02-06-2009, 02:27 PM
I think the OP means this: http://www.dynamicdrive.com/dynamicindex9/noright3.htm (http://www.dynamicdrive.com/dynamicindex9/noright3.htm)

Not really, they specified images only. However, this whole no right click business is stupid. It cannot succeed, as it is preventing the default action of the browser. Oh sure, in some browsers some of the time, and in other browsers never. But at what cost? These sorts of schemes make it hard for others to help you with your code, and sometimes are even responsible for the problem in the first place.

Given all that, my original answer is truly the correct one.

Snookerman
02-06-2009, 05:19 PM
Not really, they specified images only.
Yes, I know, I thought you didn't know what they mean by "silent right click" so I posted that but I know they want it for images only. Nevertheless, I agree with what you said, preventing right clicks is not recommended.