OK, so html markup like this;
<dt>heading 1</dt>
<dd>sub 1</dd>
<dd>sub 2</dd>
<dd>sub 3</dd>
<dt>heading 2</dt>
<dd>sub 1</dd>
<dd>sub 2</dd>
<dd>sub 3</dd>
<dt>heading 3</dt>
<dd>sub a</dd>
<dd>sub b</dd>
<dd>sub c</dd>
jquery;
$("dd:not(:first)").hide();
$("dt a").click(function(){
$("dd:visible").slideUp("fast");
$(this).parent().next().slideDown("fast");
return false;
});
What I need to do is;
all dt's closed except first one, with all children showing.
when clicked on any other dt, the child dd's shows of that dt, and the already opened dt closes.
The jquery I have is very close but only shows the first dd of any dt, whereas I need to show all the dd's of the selected dt. Phew.
Hope it makes sense. It's basically an accordion menu.
Thanks in advance!