Play with it here: http://jsbin.com/ocicu4/4/edit
Simple Accordion, I only want one section open at a time.
I figured the if statement would work, but it doesn't.
// Clicks on h3 show .sectionContent
$('h3.sectionHeading').click(function() {
if ($('h3.sectionHeading').next().is('.open')) {
// Do nothing
} else {
// Find the exsisting div.open remove class and close it
$('div.open').removeClass('open').animate(
{'height':'toggle'}, 'fast', 'linear'
);
// Make div next to h3 open and add class
$(this).next().addClass('open').animate(
{'height':'toggle'}, 'slow', 'linear'
);
}
});
Help appreciated :)