This should do it (not tested):

        $(".parent").click(function() {
                $(this).next(".sub").toggle(400);
                return false;
        });



Seb



On 24 Feb 2007, at 15:39, poncjusz wrote:

Hi everyone I've html code:

<a href="..." class="parent">Something</a>
<div class="sub">Something</div>
<a href="...">Something</a>
<a href="...">Something</a>
<a href="..." class="parent">Something</a>
<div class="sub">Something</div>
<a href="...">Something</a>

and jquery code:
$(document).ready(function() {
        $(".sub").hide();
        
        $(".parent").click(function() {
                $(".sub").toggle(400);
                return false;
        });
});

everything is ok until there is more then 1 link with parent class, when I click on link with parent class all divs with sub class slidingDown :/, what I should do? I want different behaviour: when I click on parent link only the nearest sub should slideDown.

Thanks in advance for help

Tomek

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to