I’m using jquery .show to open a div. I’ve got it working fine but I’m having a bit of trouble working out how to get it to check if the div‘s already open. If it is, I don’t want it to repeat the .show function. What’s the best way to do this?
What I’m using at the moment is (jquery + jquery ui)
$(document).ready(function() {
$('.content').hide();
$(".open").click(function () {
$(".content").show("slide", { direction: "up" },1200);
});
$(".close").click(function () {
$(".content").hide("slide", { direction: "up" },1200);
});
});
You can use the :visible selector and :hidden selector
Also see my example.