Excellent Adriana - thanks very much - also for quietly pointing out that I'd forgotten the return false bit.
Cheers/Bruce On Nov 27, 2:45 pm, Adriana <adipa...@yahoo.com> wrote: > Hi Bruce, > > Try this: > > $('.accord > h6').click(function() { > $(this).toggleClass('expand_group').siblings > ('h6.expand_group').removeClass('expand_group'); > $(this).next('fieldset').slideToggle('fast').siblings > ('fieldset:visible').slideUp('fast'); > return false; > }); > > Regards, > Adriana > > On Nov 26, 11:41 am, Bruce MacKay <thomasba...@gmail.com> wrote: > > > Hello folks, > > > I have an operational accordion based on a series of fieldset tags > > (the content) and h6 tags (the triggers). > > > It is initiated by: > > > $('.accord > h6').click(function() { > > $(this).next('fieldset').slideToggle('fast').siblings > > ('fieldset:visible').slideUp('fast'); > > > }); > > > The trigger tags are set up as > > h6 - span - Trigger title - /span - /h6 > > > I want to add a class to the current h6 tag that will result in an > > "open folder" image to appear next to tag when its associated fieldset > > is open, and have that class removed when it or another h6 tag is > > clicked. > > > I can add the class easily enough - but I can't work out the code/ > > selectors to remove the class when the clicked current trigger title > > is re-clicked (to close the fieldset) or another trigger title is > > clicked (to open its associated fieldset. > > > $('.accord > h6').click(function() { > > $(this).addClass('expand_group'); > > $(this).next('fieldset').slideToggle('fast').siblings > > ('fieldset:visible').slideUp('fast'); > > > }); > > > I'd really appreciate some direction to a solution if possible. > > > Thanks, Bruce