Closing Opened Items on Click of Another
I have this code that opens and closes a div on click of a button:
$(document).ready(function(){
$(".explorenavopen").click(function(){
$("#explorenavholder").slideDown("slow");
});
});
$(document).ready(function(){
$(".explorenavclose").click(function(){
$("#explorenavholder").slideUp("slow");
});
});
I plan to use this functionality in a few places on the pages. To do so I want to check if something else has been opened (and not closed) and if any of the other items called are still opened, close them.
Some sort if if statement that checks for 2-3 variables :items 1,2,3 are :open, close them all before opening this item.
Any help on understanding how to do this?