Forgive me if this is a newbie question:
I ve got a menu set to open the next div to see more details, and if there is another div open already it will close it while it opens the new one. I cannot figure out how to close the div already open if you click on the header associated with that div. It just closes & reopens.
Code:
$(document).ready(function() {
$(".heading").click(function(){
if($(".content").is(":visible")){
$(".less").removeClass("less");
$(".content").slideUp(500);
}
$(this).next(".content").slideToggle(500);
$(this).children(".more").toggleClass("less");
});
});
感谢任何帮助。