That sounds pretty easy:

$('.accordion').click(function() {
  $(this).siblings().toggle();
});

See it here: 
http://www.erikandcolleen.com/erik/projects/jquery/accordian_table.html

--Erik


On 2/20/07, rolfsf <[EMAIL PROTECTED]> wrote:
>
> I misspoke - now that I look at it closer and play with jquery.accordian, I
> don't want it to function like an accordion menu, since I want each grouping
> to be toggled independent of each other -- they could all be open, or all
> closed.
> sorry for the confusion...
>
>
> rolfsf wrote:
> >
> > I'm trying to figure out how to build a table that allows the user to
> > toggle groups of rows, much like the accordion menus made with Jörn's
> > accordion plugin, while keeping reasonably semantically correct markup in
> > the table.
> >
> > My best guess on the markup is posted here:
> > http://www.monkeypuzzle.net/testfiles/jquery/Accordion_table/
> >
> > briefly, it's something like:
> >
> > <table>
> >   <thead>
> >     <tr>
> >       <th>heading</>
> >       <th>heading</>
> >     </tr>
> >   </thead>
> >
> >   <tbody>
> >     <tr class="accordion">
> >       <th colspan="2" class="collapse_group">Grouping name 1</th>
> >     </tr>
> >     <tr>
> >       <td>data</>
> >       <td>data</>
> >     </tr>
> >     <tr>
> >       <td>data</>
> >       <td>data</>
> >     </tr>
> >   </tbody>
> >
> >   <tbody>
> >     <tr class="accordion">
> >       <th colspan="2" class="collapse_group">Grouping name 1</th>
> >     </tr>
> >     <tr>
> >       <td>data</>
> >       <td>data</>
> >     </tr>
> >     <tr>
> >       <td>data</>
> >       <td>data</>
> >     </tr>
> >   </tbody>
> >
> > ...etc
> > </table>
> >
> > I want to be able to click on the "Grouping" <th> and collapse/expand the
> > rest of the rows in that <tbody>, but leaving the <tr class="accordion">
> > visible.
> >
> > Can someone get me started? :-)
> >
> > thanks!
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/accordion-table%2C-instead-of-an-accordion-list-menu--tf3264032.html#a9073436
> Sent from the JQuery mailing list archive at Nabble.com.
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to