[Javascript] No right click on images

Matt Barton javascript at mattbarton.org
Wed Sep 14 05:21:49 CDT 2005


Hi Alan,

Pretend that at this point I'm telling you all the things that loads of 
other people are likely to say about it being a bad idea, bad practice, 
pointless if the client doesn't have javascript enabled etc, etc, and so 
on ad. nauseum.

What you want is something like:

	<img oncontextmenu="return false;" src= ....

  ... or ...

	<img oncontextmenu="returnValue = false;" src= ....

Try those, and have an experiment, I'm sure it's something like that.

Matt

Alan Easton wrote:
> Hello All,
>  
> I realise this type of function is quite pointless, but a client would 
> like it.
>  
> I need to disable right click on images, but I DO NOT want any alert box 
> popping up, I merely do not want the right click menu to appear.
>  
> I also need the right click to work on any other part of the screen, so 
> they can still right click and refresh, view source, etc....
>  
> Hope I have made myself clear, let me know if you need anything else 
> from me.
>  
> As usual, any help would be really appreciated.
>  
> Alan...
> 
> --
> This email has been verified as Virus free
> Virus Protection and more available at http://www.plus.net
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> --
> This email has been verified as Virus free
> Virus Protection and more available at http://www.plus.net



More information about the Javascript mailing list