當然,網路上也有滿滿的破解方法,所以這也只能防君子,不防小人~
"禁止使用滑鼠右鍵"使用方法:
請將下面的 Javascript 貼在 <head></head> 之間即可。
<script type="text/javascript">
function clickIE4(){
if (event.button==2){
return false;
}
}
function clickNS4(e){
if (document.layers || document.getElementById && !document.all){
if (e.which==2 || e.which==3){
return false;
}
}
}
function OnDeny(){
if (event.ctrlKey || event.keyCode==78 && event.ctrlKey || event.altKey || event.altKey && event.keyCode==115){
return false;
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = clickNS4;
document.onkeydown = OnDeny();
}
else if (document.all && !document.getElementById){
document.onmousedown = clickIE4;
document.onkeydown = OnDeny();
}
document.oncontextmenu = new Function("return false");
</script>
"禁止反白"使用方法:
先增加下面的 <style> 於 <head></head> 之間。
<style>
body { -moz-user-select:none; }
</style>
再在 <body> 加上 onselectstart 屬性。<body onselectstart="return false">
參考來源:StaceOverflow
沒有留言:
張貼留言