[jQuery] Re: Selecting with "this"

2007-10-24 Thread linsms
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

[jQuery] Re: Selecting with "this"

2007-10-24 Thread linsms
Thanks but this only matches the first 'p' in the first 'li' The nearest thing is: $('#texto>ol>li>p') That matches all 'p' inside the 'li' and $(this).nextAll().toggle('slow'); that matches all elements before it I need more ideas :S On 24 oct, 14:20, "Erik Beeson" <[EMAIL PROTECTED]> wrote: >

[jQuery] Re: Selecting with "this" SOLVED

2007-10-24 Thread linsms
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

[jQuery] Re: Selecting with "this"

2007-10-24 Thread Karl Swedberg
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 sh

[jQuery] Re: Selecting with "this"

2007-10-24 Thread Erik Beeson
Sounds like you only want the 'pointer' class and click handler to be applied to the first 'p'? Maybe something like this (untested): $('#texto>ol>li>p+*').hide(); $('#texto>ol>li>p:eq(0)').addClass('pointer').click(function(){ $(this).siblings().toggle(); }); See: http://docs.jquery.com/Tra