Monday 7 January 2013

Disable right click


Assalamualaikum and hai... tadi ada yang tanya macam mana nak buat disable right click... ok straight to the point...
Firstly, home --> template --> edit html
Copy this code and paste it after  <html>   or   <head>  for blogskin ...
For template designer --> Layout > Add A Gadget > Choose HTML/Javascript then, copy the code and paste on the html / javascript gadget...

With alert massage...
-->When someone right click on your blog an alert massage will appear just like the one below...


<script language=JavaScript> <!--
//edit by unwanted
var message="ALERT MASSAGE";
/////////////////////////////////// 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>

Note :

ALERT MASSAGE : Change with your massage example : CTRL + C FOR COPYING...

Without alert massage...
Alert massage will not appear...
<script language=JavaScript> <!--
//Disable right click script III- By Renigade (renigade@mediaone.net) //For full source code,
visit http://www.dauspozi.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>



...Preview and save...

No comments:

Post a Comment