【发布时间】:2012-06-16 19:45:59
【问题描述】:
我有一个这样的html表格
<html>
<head>
</head>
<body>
<div>
<div>
<table>
<tr></tr> --visible row 1
<tr></tr> --show\hide on click by visible row1
<tr></tr> --show\hide on click by visible row1
</table>
</div>
<div>
<table>
<tr></tr> --visible row 2
<tr></tr> --show\hide on click by visible row2
<tr></tr> --show\hide on click by visible row2
<tr></tr> --show\hide on click by visible row2
</table>
</div>
<div>
<table>
<tr></tr> --visible row 3
<tr></tr> --show\hide on click by visible row3
</table>
</div>
<div>
</body>
</html>
如何通过单击相应的可见行来执行 tr 的显示\隐藏。我已经看到删除下一行的示例,但是我如何在可见行的父表中显示隐藏 tr 并隐藏所有不在第一个位置的子行。
如果有人可以发布 jquery 函数,我可以解决这个问题。非常感谢。
【问题讨论】:
-
为 TRs 和点击 TRs 分配一个类,然后执行 nextSibling(clickclass)
标签: html jquery-plugins jquery