Dec 11, 2010

Disable Right Klik kat blog kita

Ni saya nak ajar korng la cara tak bagi org tekan right klik kat blog kita ek, hehe ;D yg ni klau org right klik kat blog kita ada keluar pop out window punya la, caranya la,..


With pop-up messeage

Dashboard > Design > Add Gadget > HTML/javascript

Copy n pastekan kod ni kat HTML/javascript ek ;)

<script language=JavaScript>
<!--
//edit by unwanted

var message="Mesej apa-apa je :)";
///////////////////////////////////
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>


Masukkan mesej apa2 kat yg warna pink tu ek ;D ok dh abis smpai disini sajaha :) 


Without pop-up messeage


Copy paste code ni:



<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>


lepas tu save je la. ok babai!