如何屏蔽body事件
目的:点链接时只激发href的onclick事件,屏蔽Body的onclick事件。
(点链接时显示层,点body时隐藏层)
-------------------------------------
<div id="ad100" name="ad100" style="position: absolute; top: 10; right: 10; width: 300; height: 300;cursor:hand; background-color:c0c0c0; display:none">
</div>
<div id="xx">
<a href="#" onclick="return show();" > AAAAAAAAAAAAAAAAAA </a> <br>
<a href="#" onclick="return show();" > BBBBBBBBBBBBBBBBBB </a> <br>
<a href="#" onclick="return show();" > CCCCCCCCCCCCCCCCCC </a> <br>
</div>
<script language="javascript">
function show()
{
alert( ad100.style.display );
ad100.style.display="block";
}
function hidden()
{
alert( ad100.style.display );
ad100.style.display="none";
}
</script>
<html>
<head><title> Test </title></head>
<body onclick="return hidden();">
<table width="600" height="1000" bgcolor="cccccc" align="center">
<tr><td></td></tr>
</table>
</body>
</html>