你的位置:首页 > Java教程

[Java教程]一种屏蔽鼠标右键的JS方法


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>屏蔽鼠标右键</title>
<script language="javascript">
function click(){
if (event.button==2){
alert('禁止使用鼠标右键!!!')
}
}
document.onmousedown=click
</script>
</head>
<body>
<table width="812" height="693" border="0" align="center" cellpadding="0" cellspacing="0" background="bg.jpg">
  <tr>
    <td width="250" height="220">&nbsp;</td>
    <td width="562" height="220">&nbsp;</td>
  </tr>
  <tr>
    <td height="363">&nbsp;</td>
    <td height="363" align="left" valign="top"><table cellspacing="0" cellpadding="0" >
      <tr>
        <td colspan="2">博客列表</td>
        </tr>
      <tr>
        <td width="23%">[2007-02-07] </td>
        <td width="77%">掌握自己的路标 </td>
      </tr>
      <tr>
        <td width="23%"> [2007-02-07] </td>
        <td width="77%">向前,向目标前进 </td>
      </tr>
      <tr>
        <td width="23%"> [2007-02-07] </td>
        <td width="77%">用实际行动说话 </td>
      </tr>
      <tr>
        <td width="23%"> [2007-02-07] </td>
        <td width="77%">做事要持久 </td>
      </tr>
      <tr>
        <td width="23%"> [2007-02-07] </td>
        <td width="77%">一片美好 </td>
      </tr>
      <tr>
        <td width="23%"> [2007-02-07] </td>
        <td width="77%">努力做到自己 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-21] </td>
        <td width="77%">石头与海龟 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-21] </td>
        <td width="77%">时间是金
            时光比金更珍贵 时间是海绵里的水 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-21] </td>
        <td width="77%">成功学之鉴赏 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-21] </td>
        <td width="77%">明月几时有
            把酒问青天 不知天上宫阙 今昔是何年 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-21] </td>
        <td width="77%">一起创造 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-12] </td>
        <td width="77%">努力与获得总是成正比 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-12] </td>
        <td width="77%">时间等于利益 </td>
      </tr>
      <tr>
        <td width="23%"> [2006-11-12] </td>
        <td width="77%">想与做 </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="110">&nbsp;</td>
    <td height="110">&nbsp;</td>
  </tr>
</table>

<div>http://www.999jiujiu.com/</div>
</body>
</html>