• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » How disable right click on ucoz (How to disable it???)
How disable right click on ucoz
Alex0493
Posts: 2
Reputation: 0

Message # 1 | 3:43 PM
Hello, I would like to know if have a script or other to disable the right click on website ucoz, if have one could you tell me what the scripts is and where put it ? Thanks.
Davor24
Posts: 330
Reputation: 10

Message # 2 | 7:26 PM
Paste these codes under <body> or <head> tag of your code:

Code
<script language=JavaScript>
<!--
var message="Right Clicking 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>


But i think this is one of the most annoying javascript codes. Why would you want to do that, it's not useful at all?
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 3 | 8:35 AM
Alex0493, what purpose are you disabling right click for exactly? Most of the functions usable by right-click are also usable by keyboard commands. The script above should work however.
Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
uCoz Community » For Webmasters » Custom Solutions » How disable right click on ucoz (How to disable it???)
  • Page 1 of 1
  • 1
Search: