right click disabling on a picture

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Ian Price

Thread Starter
Joined
Apr 27, 2003
Messages
63
<script language="JavaScript">
function click() {
if (event.button==2) {
alert('Hey, leave my images alone!');
}
}
document.onmousedown=click
// -->
</script>


this coding works fine for my index.html page where all my thumbnail pictures are.

When a user clicks on one of these thumbnail pictures, the picture loads the large version. But when the large picture is on screen, the user can right click on it.

How can I prevent the user from right clicking on the large picture (because that’s the one I need protecting really!)


ie.. how do i disable right clicking on this picure?
http://www.iprice.f2s.com/photos/900Dscf0156.jpg
 
Joined
Mar 28, 2004
Messages
51
Make it, instead of loading the large version, open another HTML document with the JavaScript you posted above and then with an img tag with the large image.

Remember, though, there are still several ways to get the image, most of which you can't stop.
 
Joined
Apr 30, 2001
Messages
2,636
You are wasting your time trying to prevent the right-click. That won't help at all. There are lots of other ways to get the pic(s), not to mention that some browsers can be set so that javascript doesn't affect the right-click function.

As always said before, if we can see it, we can get it. Most n00bies can get around the right-click anyway. It's not gonna help you at all. What if the visitor has javascript turned off? etc. etc.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top