I made a demo page.
http://www.commadot.com/jquery/nextrow/

Click on a row and it shows the next row.
My first syntax worked fine.
 $("table tr:odd").hide()

$("td").click( function() {
   $(this).parents("tr").next("tr").show();

  } );

Glen

On 6/27/07, Glen Lipka <[EMAIL PROTECTED]> wrote:

What about
$(this).parents("tr").next("tr.first").show();



On 6/27/07, Corey Frang <[EMAIL PROTECTED]> wrote:
>
>  Not really, that selector finds ALL "tr" then any "tr" after each of
> those.
>
> Assuming your calling it from something like this:
>
> $(".showNextRow).click(function() {
>   $(this).parents("tr").next("tr.hidden").show();
>   return false;
> });
>
> also assuming that the t1 table isn't inside another table with a
> tr.hidden.  That would get funny :)
>
> Glen Lipka wrote:
>
> $("tr").next("tr").show();
>
> Would this do it?
>
> Glen
>
> On 6/27/07, Massimiliano Marini < [EMAIL PROTECTED]> wrote:
> >
> >
> > Hi all,
> >
> > I've this table :
> >
> > <table id="t1">
> >   <tr class="visible">
> >    <td><a href="#" class="showNextRow">View Next Row</td>
> >    <td>Cell with content</td>
> >   </tr>
> >   <tr class="hidden">
> >     <td colspan="2">Hello to the jQuery community</td>
> >   </tr>
> >   ...
> >   ...
> >   ...
> > </table>
> >
> > I'm using this code to diplay the tr with hidden class :
> > $('a').filter('.visible').click(function(){
> >   $('.hidden').toggle();
> > }
> >
> > what I want to do, is to toggle or show only the "tr"(only one only
> > the next) that is under the "tr" where is the link that I've clicked.
> >
> > I think the example and the code may help more than my description of
> > the problem :)
> >
> > --
> > Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
> > "It's easier to invent the future than to predict it."  -- Alan Kay
> >
>
>
>

Reply via email to