Right-click
Moderator: General Moderators
Right-click
Can we make our page can't be right-clicked? I mean if we right-click at any pages, then nothing heppen. Anybody know?
Code: Select all
<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>From http://www.dynamicdrive.com/dynamicindex9/noright.htm
And if you want to use a silent right click.
From http://www.dynamicdrive.com/dynamicindex9/noright3.htm
Code: Select all
<script language=JavaScript>
<!--
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</script>-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Why? Right click provides no functions that a user would need to view a page or navigate... a user visiting a site dont need right click peroid unless they are up to no good, so as far as right click disabling being lame, thats just silly.monkeyj wrote:Hey personally.. I find anti-right clicking sites are annoying..
Don't do it.. o.o
I mean
If the person wants your image..
They can d/l it from the source... directly.. or w/e..
but.. Disabling right click is lame.. o.o
Just put SAMPLE over it..
but it is annoying o.o
If you're trying to save an image, rather than hotlink it, right clicking makes it easier, not necessary for the job, but much easier. Plus, it's annoying if you hit the button by accident and a "Don't do that" alert box pops up.
I agree, anti-right-click nazis need to lighten up. <hippyvoice>The mouse has two buttons for a reason, man.</hippyvoice>
I agree, anti-right-click nazis need to lighten up. <hippyvoice>The mouse has two buttons for a reason, man.</hippyvoice>
What I'm saying is, if you're going to use an image from elsewhere on your site (assuming of course this is kosher in a particular instance), it's much more considerate to save it for yourself, rather than use the original site's bandwidth.
Or if you have dial-up access, and you want to be able to come back to a particular picture, it's much easier than waiting for it to load all the time.
Or if you have dial-up access, and you want to be able to come back to a particular picture, it's much easier than waiting for it to load all the time.
the only valid reason i see for right click is when you download a MP3 or a file, I know I personally like the Right click ->Save Target As, but could easily go without.... and if the webmaster of the page Has a page that has file downloads, then implenting the right click disable would be strange, none the less..
Right click isnt needed peroid.
Right click isnt needed peroid.