调用这个函数时,为何隔格没有隐藏?

hehe6 2004-11-03 05:26:46
调用这个函数时,为何隔格没有隐藏?
function show()
{
document.form1.table1.visibility=display;
}
...全文
107 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
hehe6 2004-11-04
  • 打赏
  • 举报
回复
多谢
JK_10000 2004-11-04
  • 打赏
  • 举报
回复
contains Method

--------------------------------------------------------------------------------

Checks whether the given element is contained within the object.

Syntax

bFound = object.contains(oElement)

Parameters

oElement Required. Element object that specifies the element to check.

Return Value

Boolean. Returns true if the element is contained within the current element, or false otherwise.

hehe6 2004-11-04
  • 打赏
  • 举报
回复
多谢楼上
table1.contains(event.toElement)
是什么意思啊,我对JS不是太了解,能解释一下吗?
JK_10000 2004-11-04
  • 打赏
  • 举报
回复
<html>

<head>
<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>
hehe6 2004-11-04
  • 打赏
  • 举报
回复
啊,<table border=1 id=table1 oumouseout=hidden()>
function hidden()
{
table1.style.display="none";
}
鼠标依然在表格上方时,只要离开表格线,表格还是会隐藏,
怎么才能使鼠标离开表格区域后,表格才能隐藏?
kingchang2000 2004-11-04
  • 打赏
  • 举报
回复
table1.style.display=""
hehe6 2004-11-04
  • 打赏
  • 举报
回复
直接用table1.style.display="none"就隐藏了,多谢楼上各位兄弟了,
还有一问,那要是想让这个表格显示出来怎么写啊?
huhanshan013 2004-11-04
  • 打赏
  • 举报
回复
document.table1.style.display="none";
这样把,估计你的表格不在表单里面,表格也不是表单元素
是这个吧
你把那个表格的name和id属性都设置为table1
hehe6 2004-11-04
  • 打赏
  • 举报
回复
不行啊,还是不隐藏
SuperBJack 2004-11-03
  • 打赏
  • 举报
回复
function show()
{
document.form1.table1.style.visibility=hidden;
}

or

document.form1.table1.style.display="none";
JK_10000 2004-11-03
  • 打赏
  • 举报
回复
table1.style.display="none";
or
table1.style.visibility="hidden";
hehe6 2004-11-03
  • 打赏
  • 举报
回复
UP

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧