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
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:
>
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 sh
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
5 matches
Mail list logo