Solved. Working version:
        $('#texto>ol>li>p+*').hide();
        $('#texto>ol>li>p:visible').addClass('pointer').click(function(){
                                $(this).nextAll().toggle('slow');
                                });


On 24 oct, 15:28, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Rather than "+", try using "~". That should get all siblings that
> follow. See this page in the API reference for more 
> info:http://docs.jquery.com/Selectors/siblings#prevsiblings
>
> --Karl
>
> On Oct 24, 2007, at 7:45 AM, linsms wrote:
>
>
>
> > Hi,
> > I want to make a really simply thing: hide and show "p" elements in a
> > list clicking in the first "p"
> > I have this code in document.ready function:
>
> >    $('#texto>ol>li>p+*').hide();
> >    $('#texto>ol>li>p').addClass('pointer');
> >    $('#texto>ol>li>p').click(function(){
> >            $('this+*').toggle(); <- this is not working
> >            });
>
> > I've try $('+*',this).toggle(); but it only matches the first element
> > after this and I want to match all elements in list after this element
> > (all brothers)
>
> > Any ideas?
> > Thanks

Reply via email to