Close divs with animation when click on another
I have multiple divs that I want to open an close on click. I can get them to open easily and close with a different call, however I want to automatically close any open divs when I click on a new one (so that only one is open at any one time)
I am using the html:
<div class="alphabet"></div>
and the jquery:
$(document).ready(function() {
$(".alphabet").click(function() {
$(this).animate({width: "13%",height: "500px"}, 1000);
});
});
can anyone advise on this please?