/    Sign up×
Community /Pin to ProfileBookmark

yet another right click script

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliAug 31.2003 — 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.
×

Success!

Help @decibleXL spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...