473,598 Members | 3,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RIGHT Mouse Button - on Click? Prevent photo download

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
Jul 20 '05 #1
8 9763
"Alpenvrouw tje" <al***********@ nospam.com> writes:
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[i].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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
In article <tr************ **********@amsn ews02.chello.co m>,
al***********@n ospam.com enlightened us with...
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
-------------------------------------------------
Jul 20 '05 #3
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" <lr*@hotpop.com > wrote in message
news:1x******** **@hotpop.com.. .
"Alpenvrouw tje" <al***********@ nospam.com> writes:
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[i].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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #4
Alpenvrouwtje wrote:
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="imagetoo lbar" 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

Jul 20 '05 #5
rf

"Alpenvrouw tje" <al***********@ nospam.com> wrote in message
news:tr******** **************@ amsnews02.chell o.com...
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.
Jul 20 '05 #6
In article <EE************ ********@news-server.bigpond. net.au>,
ma**********@th e.time enlightened us with...

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
-------------------------------------------------
Jul 20 '05 #7
rf

"kaeli" <in************ ********@NOSPAM att.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
In article <EE************ ********@news-server.bigpond. net.au>,
ma**********@th e.time enlightened us with...

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?


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.
Jul 20 '05 #8
In article <2h************ ********@news-server.bigpond. net.au>,
ma**********@th e.time enlightened us with...
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.


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
-------------------------------------------------
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9652
by: Lijun Yang | last post by:
Hey, I am able to disable the right mouse button on images for netscape and IE but it won't work for Opera. Here is the code: // start of the code var clickmessage="Sorry, you don't have permission to right-click." function protectImages () {
5
1672
by: Someone | last post by:
I know many don't like having right click disabled, however this is a unique case where clients using viewing this particular site will not be world wide so it's not going to affect too many people. I have searched google archive for this newsgroup for a solution but similar posts never received answers. I have a script that disables right mouse button that works in IE and older versions of NS but it doesn't work in NS7. Can anyone...
12
1710
by: Veeresh | last post by:
In my asp.net application I want to block mouse right click on my web pages. That means instead of popup menu I may just display some message or no message at all. Hot to do that? Thanks, Veer
13
2292
by: James Bond | last post by:
Hello. My 80+ year old father has recently decided to get his first computer. Due to his age (and I suspect lack of playing pong as a child like I did) he lacks the manual dexterity to use a mouse well. He is frequently missing the left mouse button and hitting the right, or less often the middle (wheel) buttons. While he is very slowly getting better with practice, the frustration level is high for him as a result of this (he gets very...
2
6796
by: Dino M. Buljubasic | last post by:
I have a list view with couple of items in it. When I left click on an item, a form opens displaying that item's properties. So that works fine. However, accidentally I found out that when I right click on my list view item, the click event gets generated twice and causes my application to crash because sender.parent is nothing. How can I restrict my list view to react only on left click or behave the same way even when right...
4
10793
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't not want to display this menu if a node selected on the listview but user right click over the empty space of the panel that contain the listview. The problem here is when I use the Listview's Click Event, I don't have ways to verify if the...
7
3584
by: Steve | last post by:
How do you disable the mouse right click to prevent pop-up window? Or if I want to have cut/copy/paste on pop-up window use same code as my custom cut/copy/paste that are triggered by toolstrip buttons? Thanks Steve
2
5436
by: ImageAnalyst | last post by:
Does anyone know how to get rid of excess mouse clicks? I have a button that does some code which takes some time to execute. As soon as the user clicks the button, I disable the button in the button handler and enable it again when I exit the handler. However, if the user clicks a bunch of times, say 10, during the time it's disabled and executing for the first time, it will start to process the second mouse click the moment the button...
8
3688
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? ----------------------------------------------------------------------- The oncontextmenu intrinsic event is the only safe and reliable method. Of the other approaches often presented, most depend on an alert box interrupting the process and rarely work. Note that oncontextmenu is a non-standard event and is not...
0
7902
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8265
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3898
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.