Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Mouse right side button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mouse right side button

 Post Reply Post Reply Page  12>
Author
Eagle View Drop Down
Newbie
Newbie


Joined: 09 November 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Eagle Quote  Post ReplyReply Direct Link To This Post Topic: Mouse right side button
    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?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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>

Back to Top
BoLt View Drop Down
Senior Member
Senior Member


Joined: 20 November 2003
Location: United Kingdom
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote BoLt Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Eagle View Drop Down
Newbie
Newbie


Joined: 09 November 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Eagle Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 5:13pm

Thank you very much for your help.

This should do the work just fine.

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Licttum View Drop Down
Newbie
Newbie


Joined: 02 September 2003
Location: Australia
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Licttum Quote  Post ReplyReply Direct Link To This Post 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".

Back to Top
Eagle View Drop Down
Newbie
Newbie


Joined: 09 November 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Eagle Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.