Forums
This topic is locked
disable right-click
Posted 14 Nov 2002 07:42:26
1
has voted
14 Nov 2002 07:42:26 Dave Clarke posted:
hi alljust a quickie, does anybody know how to disable right click for a page??
and also disable the image toolbar that IE users get when they mouse over an image?
thanks
Dave
ASP|VBScript|IIS5.1|WinXPPro & WinXPHome
Replies
Replied 14 Nov 2002 10:43:11
14 Nov 2002 10:43:11 Stefan P replied:
I needed this a while ago and found a simple javascript at
www.javascriptkit.com
Regards
Stefan
UD4 | ASP | VBScript | ACCESS | IIS5
www.javascriptkit.com
Regards
Stefan
UD4 | ASP | VBScript | ACCESS | IIS5
Replied 14 Nov 2002 18:05:43
14 Nov 2002 18:05:43 Dave Clarke replied:
cheers, will have a look
ASP|VBScript|IIS5.1|WinXPPro & WinXPHome
ASP|VBScript|IIS5.1|WinXPPro & WinXPHome
Replied 15 Nov 2002 09:15:45
15 Nov 2002 09:15:45 Vince Baker replied:
Here is the code:
<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 15 Nov 2002 19:06:44
15 Nov 2002 19:06:44 Dave Clarke replied:
Thanks Vince, that'll do nicely.
Dave
ASP|VBScript|IIS5.1|WinXPPro & WinXPHome
Dave
ASP|VBScript|IIS5.1|WinXPPro & WinXPHome