Tuesday, February 22, 2011

Disable Right Click (Got Pop Out)

这个教学是给我朋友   黄忆瑾   的 ^^


封锁右键功能  而且  有弹窗的




Step :


Dashboard ---> Design/Layout --->  Add a Gadget ---> HTML/JavaScript


After that, copy down the code below and paste into HTML.




<script language="JavaScript">
<!--

//Disable right mouse click Script

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>








*  ATTENTION




you can change the  word been BOLD by me to the 


word you wanna show ^^ 

1 comment: