JQuery collapse table cells based on class

Posted by H4mm3rHead on Stack Overflow See other posts from Stack Overflow or by H4mm3rHead
Published on 2010-04-19T19:00:02Z Indexed on 2010/04/19 19:03 UTC
Read the original article Hit count: 321

Filed under:
|

Hi i have a table strcture for my menu, and i need to be able to collapse/expand the menu from level2, so that all level3 cells becone visible. My HTML is like this:

<table>
<tr><td class="level1"><a href="abc.html">First Item</a></td></tr>
<tr><td class="level2"><a href="def.html">SecondItem</a></td></tr>
<tr><td class="level3"><a href="ghi.html">Third Item</a></td></tr>
<tr><td class="level3"><a href="jkl.html">Fourth Item</a></td></tr>
<tr><td class="level3"><a href="mno.html">Fifth Item</a></td></tr>
<tr><td class="level2"><a href="pqr.html">Sixth Item</a></td></tr>
<tr><td class="level2"><a href="stu.html">Seventh Item</a></td></tr>
</table>

How do i, when i press the level2 item i only collapse/expand the level3 items following the level2 i pushed? I only want to do this for level2, not for level 1.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html