contains Method--------------------------------------------------------------------------------Checks whether the given element is contained within the object. SyntaxbFound = object.contains(oElement)ParametersoElement Required. Element object that specifies the element to check. Return ValueBoolean. Returns true if the element is contained within the current element, or false otherwise.
{
document.form1.table1.style.visibility=hidden;
}or document.form1.table1.style.display="none";
这样把,估计你的表格不在表单里面,表格也不是表单元素
是这个吧
你把那个表格的name和id属性都设置为table1
还有一问,那要是想让这个表格显示出来怎么写啊?
function hidden()
{
table1.style.display="none";
}
鼠标依然在表格上方时,只要离开表格线,表格还是会隐藏,
怎么才能使鼠标离开表格区域后,表格才能隐藏?
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<table border=1 id=table1 onmouseout="hiddenFun()" >
<tr><td>fdsafdsa</td><td>fdsafdsa</td><td>fdsafdsa</td></tr>
<tr><td>fdsafdsa</td><td>fdsafdsa</td><td>fdsafdsa</td></tr>
<tr><td>fdsafdsa</td><td>fdsafdsa</td><td>fdsafdsa</td></tr>
</table>
</body></html>
<script language=javascript>
function hiddenFun()
{
if(!table1.contains(event.toElement))
table1.style.display="none";
}
</script>
table1.contains(event.toElement)
是什么意思啊,我对JS不是太了解,能解释一下吗?