I made this widget at MyFlashFetish.com.

禁用右键功能(Right Click)

方法 1


Disable Right Click ( 无跳窗)


首先
设计添加小工具  > 添加HTML/Java Script功能
将以下代码放进去按储存就可以了



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





方法 2 :

Disable Right Click ( 有跳窗的)

首先
设计添加小工具  > 添加HTML/Java Script功能
将以下代码放进去按储存就可以了



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

//Disable right mouse click Script

var message="诶诶!你干嘛!?";

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



PS : 红色字可以自己更改



祝大家成功
 [ END ]

没有评论:

发表评论