How can I achieve this with jQuery?
- If
<a href="#" class="accordion-link">is clicked, add class ‘active’. - If any other
<a href="#" class="accordion-link">is clicked, hide active from all and add to this. - If
<a href="#" class="accordion-link active">is clicked, remove “active” (this last one is in the event they close the div that is currently active, it will remove the ‘active’ class).
How about this:
http://jsfiddle.net/QA7mU/