Print Page | Close Window

Mouse right side button

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9968
Printed Date: 31 March 2026 at 3:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Mouse right side button
Posted By: Eagle
Subject: Mouse right side button
Date Posted: 12 April 2004 at 4:10pm
Could anyone tell me if there is a code to prevent someone of using his mouse right side button on a specific web page?



Replies:
Posted By: michael
Date Posted: 12 April 2004 at 5:00pm

There is no code in the world that would ever prevent someone from pressing the right mouse button +click+ BUT you can prevent someone from gettin an applications (i.e. IE) context menu when they press the right button.
Something like the following sure is not fool proof but should prevent the majority of your users to get a context menu:
(you don't have to give the a message box, you can take that out so nothing happens when they right click)


<script language="JavaScript">
<!--
var message="Ouch!";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> </script>



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: BoLt
Date Posted: 12 April 2004 at 5:03pm

Copy this Java Script into the head of the html

Hope this helps

<SCRIPT LANGUAGE="JAVASCRIPT">
<!-- Begin
var message="Sorry but I can not let you copy or save!!";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// End -->
</SCRIPT>



-------------
BoLt (Computer Engineer)
I suffer from Dyslexia, it means I can not spell to well not that I am thick.

www.welshlens.co.uk


Posted By: Eagle
Date Posted: 12 April 2004 at 5:13pm

Thank you very much for your help.

This should do the work just fine.



Posted By: dpyers
Date Posted: 12 April 2004 at 5:20pm
Just out of curiousity, why would you want to prevent a user from using a feature they're used to?

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Licttum
Date Posted: 12 April 2004 at 6:25pm

yeh i would have to say that any site that prevents me from right clicking, I am not going to stay on it for long...

i have dual monitors and like to right click and "open link in new window".



Posted By: Eagle
Date Posted: 12 April 2004 at 9:38pm

Originally posted by dpyers dpyers wrote:

Just out of curiousity, why would you want to prevent a user from using a feature they're used to?

Well in fact, it is not for my own site. It's for my wife’s personal site. She didn't want the people to be able to cut and paste her family pictures that she put on her site. As for myself, I would rather let the people use this feature, but if that what she wants.



Posted By: michael
Date Posted: 12 April 2004 at 10:17pm
If someone wants the picture really bad there is not so much you can do about it and if it is to make a screenshot and crop it out. There has been a lengthy thread about it some time ago, though to sum up, if someone wants your wifes picture as their desktop bg there is not much you can do about it unless taking the pics offline.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: dpyers
Date Posted: 12 April 2004 at 11:53pm

In the Body tag place: oncontextmenu="return false" - eliminates the need for java script. If I turn off java script, I can right-click to my hearts content.

But michael is right. Last count there were 7 or 8 ways to grab images. the one I use is the IE "Save As" which makes a copy of the page and all images into the directory of your choice.

Another popular one is "View Source" to get the url of the images. Anything you view on your PC is stored in the internet temp directory - including the images.

BTW - the following script will kill a disable-right-click script on any given page

javascript:document.body.onmousedown=null;

I have it set up as an href within an anchor. You can put this code in an html page and drag the link to your links bar and use it to disable a no-right-click script on any page

<a href="javascript:document.body.onmousedown=null; void 0;">enable right-click menu</a>

javascript document.body.onmousedown=null; void 0; - enable right-click menu '> 



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: BoLt
Date Posted: 13 April 2004 at 7:55am

Originally posted by michael michael wrote:

If someone wants the picture really bad there is not so much you can do about it and if it is to make a screenshot and crop it out. There has been a lengthy thread about it some time ago, though to sum up, if someone wants your wifes picture as their desktop bg there is not much you can do about it unless taking the pics offline.

I have been down this road in this forum, and the best way to help stop downloading is to place a copy stamp over the photo. After all how can you stop someone downloading a photo that has been downloaded already onto the visitors PC to view it.

I have a photography site and there are many things you can to to help or make it harder but no way can you stop the most determined. A copy stamp on the photo can also be removed by photoshop and know-how. So two best ways are....

  1. Copy stamp on pic (copyright)
  2. Reducing the size so it can not be used for wallpaper or printed off to a large scale.

Hope this helps



-------------
BoLt (Computer Engineer)
I suffer from Dyslexia, it means I can not spell to well not that I am thick.

www.welshlens.co.uk


Posted By: Semikolon
Date Posted: 13 April 2004 at 11:22am

or password protect and let only trusted visitors have a password

but maybe this wont do it in most cases.

 

Originally posted by BoLt BoLt wrote:

A copy stamp on the photo can also be removed by photoshop and know-how. So two best ways are....

It depends on where you place it and how you do it



Posted By: BoLt
Date Posted: 13 April 2004 at 12:23pm

Originally posted by <SPAN =bold>Semikolon</SPAN> Semikolon wrote:

It depends on where you place it and how you do it

True, the only way I have found is to shadow a copyright over all the photo in large text. I do not do this as it would defeat my goals. I just reduce the photo so it can only be printed at limitations as well as placing a small copy stamp.



-------------
BoLt (Computer Engineer)
I suffer from Dyslexia, it means I can not spell to well not that I am thick.

www.welshlens.co.uk


Posted By: dpyers
Date Posted: 13 April 2004 at 3:25pm

I've also seen people put a transparent gif over the photo. When you right-click "save as", you get the gif. People aslo embed the photos within Flash. There are dis-assemblers around, but it prevents casual theft. Of course, they could print-screen and copy it into a paint program frm the clipboard and then trim as desired.

Most of the professional sites I've seen use an image that has been saved as lower quality to prevent professional re-use. The often put the watermark on it as well.

Bottom line is that if the pics are available for anyone to view, then anyone can get them. If you just want a select audience to view/download them, use a password protected directory.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: pmormr
Date Posted: 17 April 2004 at 3:16pm

Originally posted by Licttum Licttum wrote:

i have dual monitors and like to right click and "open link in new window".

In IE... Shift + Left Click



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: neotrix
Date Posted: 18 April 2004 at 6:14am
Originally posted by michael michael wrote:

There is no code in the world that would ever prevent someone from pressing the right mouse button +click+ BUT you can prevent someone from gettin an applications (i.e. IE) context menu when they press the right button

Good One There Michael



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net