Forums
This topic is locked
right click behavior
Posted 28 Jan 2003 11:08:38
1
has voted
28 Jan 2003 11:08:38 Michele Kimmi posted:
Hi All,could anyone give me a good tip to find a behavior that disable the right click mouse options in a web page?
Thanx in advance
Replies
Replied 28 Jan 2003 12:09:45
28 Jan 2003 12:09:45 Vince Baker replied:
Here you go, this is the code i use.
<script language="JavaScript">
<!--
var popup="Sorry, right-click is disabled.\n\nThis Site Copyright
©2000";
function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=noway;
// --> </script>
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
<script language="JavaScript">
<!--
var popup="Sorry, right-click is disabled.\n\nThis Site Copyright
©2000";
function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=noway;
// --> </script>
Regards
Vince
Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 28 Jan 2003 14:25:26
28 Jan 2003 14:25:26 Michele Kimmi replied:
thank you Vince,
but...i tried to put your code both in head both in body but dont work.
Have you got more information to give me please to make it working?
Thanx a lot for your help
Kimmi
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Here you go, this is the code i use.
<script language="JavaScript">
<!--
var popup="Sorry, right-click is disabled.\n\nThis Site Copyright
©2000";
function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=noway;
// --> </script>
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
but...i tried to put your code both in head both in body but dont work.
Have you got more information to give me please to make it working?
Thanx a lot for your help
Kimmi
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Here you go, this is the code i use.
<script language="JavaScript">
<!--
var popup="Sorry, right-click is disabled.\n\nThis Site Copyright
©2000";
function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=noway;
// --> </script>
Regards
Vince
Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>