RIGHT Mouse Button - on Click? Prevent photo download

A

Alpenvrouwtje

Hallo,

Does anyone have a (simple?) javascript code for me to
prevent that people take the photo's of my website while
they use the right mouse button.
I know that there are ways around this and people can
still get the picture, but in that case it is much less easier
and only the handy people can get it then. That already
helps.

Thanks so much,
Nicolien Avis
 
L

Lasse Reichstein Nielsen

Alpenvrouwtje said:
Does anyone have a (simple?) javascript code for me to
prevent that people take the photo's of my website while
they use the right mouse button.

For maximum annoyance:
<body oncontextmenu="return false">

For less annoyance:

for (var i=0;i<document.images.length;i++) {
document.images.oncontextmenu = function (){ return false;};
}
I know that there are ways around this and people can
still get the picture, but in that case it is much less easier
and only the handy people can get it then.

That is pretty much anybody who can walk and chew gum at the same
time.
That already helps.

Who? What are you trying to achieve, except annoying users?

/L
 
K

kaeli

Hallo,

Does anyone have a (simple?) javascript code for me to
prevent that people take the photo's of my website while
they use the right mouse button.
I know that there are ways around this and people can
still get the picture, but in that case it is much less easier
and only the handy people can get it then. That already
helps.

Anyone with enough sense to know how to disable javascript can get them.
That covers anyone under 40 and half the people over 40 who know what
javascript is.
Disabling the right mouse button disables other functions. Nothing like
pissing off all your users, eh?

You want to make it hard for people to get them? Cover them with a
spacer gif so right-click->save saves the spacer, not the image (can be
done with CSS or with tables with background image set to your image and
a spacer as the cell content). Then people have to go look up the name
of the image in your code and either get it from your server or their
browser cache. Set no-cache so that the page doesn't cache and protect
the file on your server with .htaccess and it really becomes a pain to
get it. The only way then is to open the file from the cache and save it
under a new name while the browser is open on the current page.

Is it really worth it when all you have to do to make people not want it
is watermark it?

-------------------------------------------------
~kaeli~
Hey, if you got it flaunt it! If you don't, stare
at someone who does. Just don't lick the TV screen,
it leaves streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 
A

Alpenvrouwtje

Thanks. The code works.
Now I just noticed that some small icons appear
on top of the picture (photo) and that it is possible to download the photo
via the icons. You probably already
knew, I never knew what the icons where for. Is there
some way to get rid of the icons?

Thank you for your help.
Nicolien Avis


Lasse Reichstein Nielsen said:
Alpenvrouwtje said:
Does anyone have a (simple?) javascript code for me to
prevent that people take the photo's of my website while
they use the right mouse button.

For maximum annoyance:
<body oncontextmenu="return false">

For less annoyance:

for (var i=0;i<document.images.length;i++) {
document.images.oncontextmenu = function (){ return false;};
}
I know that there are ways around this and people can
still get the picture, but in that case it is much less easier
and only the handy people can get it then.

That is pretty much anybody who can walk and chew gum at the same
time.
That already helps.

Who? What are you trying to achieve, except annoying users?

/L
 
D

Dom Leonard

Alpenvrouwtje said:
Now I just noticed that some small icons appear
on top of the picture (photo) and that it is possible to download the photo
via the icons. Is there
some way to get rid of the icons?


<meta http-equiv="imagetoolbar" content="no">

I occasionally turn the toolbar off because it looks bad. There is an IE
attribute of the IMG tag (galleryimage="0" or something, not quite sure)
that can do it for a single image, but the page won't validate correctly.

Dom
 
R

rf

Alpenvrouwtje said:
Hallo,

Does anyone have a (simple?) javascript code for me to
prevent that people take the photo's of my website while
they use the right mouse button.

Using the right mouse button to steal pictures is far too much trouble. One
has to negotiate menus and dialog boxes and all sorts of things.

It is *much* easier to simply left click on the image and drag it over to
ones image editor.

Aha, I hear you say. You'll disable the left mouse button as well :)

Cheers
Richard.
 
K

kaeli

Using the right mouse button to steal pictures is far too much trouble. One
has to negotiate menus and dialog boxes and all sorts of things.

It is *much* easier to simply left click on the image and drag it over to
ones image editor.


Cool trick, but why can't I get it to work when the pictures are links?

*pout*


-------------------------------------------------
~kaeli~
Hey, if you got it flaunt it! If you don't, stare
at someone who does. Just don't lick the TV screen,
it leaves streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 
R

rf

Cool trick, but why can't I get it to work when the pictures are links?

Because if the image is in a link you are drag/dropping the link, not the
image. You will have to drop down view>source, find the URL of the image and
copy/paste that into your browsers address bar. Then you can drag/drop the
image. No problem.

Cheers
Richard.
 
K

kaeli

Because if the image is in a link you are drag/dropping the link, not the
image. You will have to drop down view>source, find the URL of the image and
copy/paste that into your browsers address bar. Then you can drag/drop the
image. No problem.

Cool.
Thanks Richard.

-------------------------------------------------
~kaeli~
Hey, if you got it flaunt it! If you don't, stare
at someone who does. Just don't lick the TV screen,
it leaves streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top