This should work: $("div.togglecontainer div.togglebutton").click(function() { $(this).siblings("div.toggletarget").slideToggle(); }); $('div.toggletarget').hide();
A couple of notes: - I combined your first two selectors into one - I've used .click(fn) in place of .bind("click", fn) - No need for .each as .click will automatically do .each inside it - I first changed your .parent().find("div.toggletarget") to .parent().children("div.toggletarget") - this was your biggest issue - I then substituted .siblings for .parent().children("div.toggletarget") - No need to compare event.target, nor return false, since you are binding to elements with no descendants - Richard On Fri, Nov 14, 2008 at 12:34 PM, sinkingfish <[EMAIL PROTECTED]> wrote: > > > Thanks for the reply Richard, unfortunately that wasn't the issue. Ive > tided > up my example to make it clearer : http://pastie.org/314976 > http://pastie.org/314976 > > So at startup you should see 'Click me' then upon clicking, 'I'm Hidden' & > 'Click ME To see more' will be revealed. After clicking 'Click ME To see > more', 'Nested Hidden' would be revealed. > > Thanks for the help > > > > Richard D. Worth-2 wrote: > > > > You may want to start by validating your html. You're missing a closing > > </div>, so it's not clear how you intend it to be nested. Once you've > > corrected that, let us know if you still have a problem. > > > > - Richard > > > > On Fri, Nov 14, 2008 at 10:26 AM, sinkingfish <[EMAIL PROTECTED]> > > wrote: > > > >> > >> > >> Hi, > >> > >> Im new to jQuery and looking for a bit of help. Im trying to have > >> toggleable > >> content within toggleable content. > >> > >> > >> http://pastie.org/314861 Code > >> > >> > >> It's just not working for me, when I click the first toggle all is > >> revealed? > >> Am I way off? Something to do with propagation? > >> > >> Thanks > >> Brian > >> -- > >> View this message in context: > >> > http://www.nabble.com/Nesting-toddle-div%27s-tp20502521s27240p20502521.html > >> Sent from the jQuery General Discussion mailing list archive at > >> Nabble.com. > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Nesting-toggle-div%27s-tp20502521s27240p20505081.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >