Click to See Complete Forum and Search --> : yet another right click script


decibleXL
08-30-2003, 11:39 AM
hi all. I dont know javascript and I need someone's help.

I need a script that disallows the right click (save as) menue. I'd like it to be cross-browser (IE, Netscape, Mozilla). Now I realise that there are a ton of free scripts that do this very thing, but I dont want it to effect the entire page. I want to be able to dictate exactly which images the script effects by encapsulating the desired images' href tags with something that tells it to refer to the script. Any image without that reference in its href wont be effected and will behave normally.

I also realise that anyone with any wits can circumvent this by getting the images from their cache or turning off javascript, but this is mainly a detourant for the non tech types.

thanks,
dustin brown

Khalid Ali
08-31-2003, 05:57 AM
sounds like you are already familiar with thi skind of script,
well this is what you will need to implement inyour situation.

use the onclick event call of the imag you want this functionality to work for.

and then call the no right click function (which I am assuming you already have )

mak sure you put return false in the onclick event call.

<img src="..." onclick="noRightClick();return false">

I am sure this will work for you.