方法一
<script language="JavaScript">
document.oncontextmenu=new Function("event.returnValue=false;"); // 禁止右键功能,单击右键将无任何反应
document.onselectstart=new Function("event.returnValue=false;"); // 禁止先择,也就是无法复制
</script>
把上述代码加入到网页中的<head>与</head>之中就可生效.方法二
使右键失效
将<body>改成<body oncontextmenu=self.event.returnValue=false>
该方法须IE5以上来源:http://www.ite5e.com/news.php?sid=44
<script language="JavaScript">
document.oncontextmenu=new Function("event.returnValue=false;"); // 禁止右键功能,单击右键将无任何反应
document.onselectstart=new Function("event.returnValue=false;"); // 禁止先择,也就是无法复制
</script>
把上述代码加入到网页中的<head>与</head>之中就可生效.方法二
使右键失效
将<body>改成<body oncontextmenu=self.event.returnValue=false>
该方法须IE5以上来源:http://www.ite5e.com/news.php?sid=44
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>禁止右键</title>
<style type=text/css>body{
-moz-user-select:none;
hutia:expression(this.onselectstart=function(){return(false)});
}</style>
<script language="JavaScript">
document.oncontextmenu=function(e){return false;}
</script></head>
aaa
</html>