我的代码如下,执行没有反应,那位有好的方法,谢谢!
<script type="text/javascript" language="javascript">
function rightKey(){
if(event.button==2){ //判断按下的是否是鼠标右键
event.returnValue=false;
alert("禁止使用鼠标右键!");
}
}
</script>
<object id="obj" width=550 height=180 classid="CLSID:106E49CF-797A-11D2-81A2-00E02C015623" onMouseDown="rightKey()">
<script type="text/javascript" language="javascript">
function rightKey(){
if(event.button==2){ //判断按下的是否是鼠标右键
event.returnValue=false;
alert("禁止使用鼠标右键!");
}
}
</script>
<object id="obj" width=550 height=180 classid="CLSID:106E49CF-797A-11D2-81A2-00E02C015623" onMouseDown="rightKey()">
right = new Object();
right.onMouseMove = function() {
Stage.scaleMode = "noScale";
};
Mouse.addListener(right);
bind("contextmenu", function() {
if (window.event) {
window.event.returnValue=false;
}
});
http://www.jb51.net/article/19979.htm
document.onmousedown=function(evt){
evt=evt||window.event;
if(evt.button===2){
try{
evt.preventDefault();
}catch(e){
evt.returnValue=false;
}finally{
alert('禁止鼠标右键');
}
}
};
};