今天在做例子的时候,遇到一个问题,贴出来,做为自己待解决问题,
也希望能得到高人的指点。
HTML代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>禁止访问页面元素的快捷菜单</title>
<script language="javascript" type="text/javascript">
function nomenu()
{
alert('对不起,不行');
event.returnValue=false;
}
</script>
</head>
<body>
<form action="" method="get">
<SPAN STYLE="color: #0F0; width: 300px;" οncοntextmenu="nomenu()">
<P>The context menu never displays when you right-click in this box.</P></SPAN>
</form>
</body>
</html>
在firefox里无法显示,而且在DW里会提示如下:
“width不能应用到所选内容,因为其不能被继承,它适应于封装标签”