PDA

View Full Version : Disable ricght clicking?



index.html
03-04-2007, 03:10 AM
Can anyone tell me the code for disabling right clicking please? Thanks

Verrou
03-04-2007, 03:54 AM
Whats the use of disabling right click?

For source: Firefox = Ctrl + U
For Images: Firefox = Tools >> Page Info

No use disabling right click when people can still access everything, people just get peeved off they can't right click and go somewhere else.

But if you still want to, search google, lazy person.

Matt.
03-04-2007, 06:52 AM
People will still be able to view the source and get images even if you do use disable right click :(.

http://www.dynamicdrive.com/dynamicindex9/noright.htm

That page should help :).

-::Mr.Dave::-
03-04-2007, 06:58 AM
Here you go:


script language=JavaScript>
<!--
//Disable right click script III- By Renigade ([email protected])
//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.oncontext menu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</script>
<SCRIPT language="JavaScript1.2">
//Disable select-text script (IE4+, NS6+)- By Andy Scott
//Exclusive permission granted to Dynamic Drive to feature script
//Visit <http://www.dynamicdrive.com> for this script
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</SCRIPT>

Mentor
03-04-2007, 03:39 PM
Removeing ring click just makes a site seem noobish, as it gives no advantage other than ******* a few people off.

Useing a few pages of code to acheave it though, kinda proves your a complete and utter moron.
If you going to do somthing stupid, at least do it properly.

Add this in to your body oncontextmenu="return false;" so you have
<body oncontextmenu="return false;">

That will remove the right click context menu.

Although i would advise. Dont use it, it makes your site look crap, and you look like a ****.

Florx
03-04-2007, 04:44 PM
Removeing ring click just makes a site seem noobish, as it gives no advantage other than ******* a few people off.

Useing a few pages of code to acheave it though, kinda proves your a complete and utter moron.
If you going to do somthing stupid, at least do it properly.

Add this in to your body oncontextmenu="return false;" so you have
<body oncontextmenu="return false;">

That will remove the right click context menu.

Although i would advise.

well said dont do it

Want to hide these adverts? Register an account for free!