I've used some of the information here to create a toggle state check, which worked fine with a regular instant toggle, but how do I apply it to a slideToggle with slow animation? Here's my code:
$('#elemToggle').click(function() {
$("#elem").slideToggle('slow');
if($("#elem").is(":visible")) {
$('#elemToggle').addClass('down');
$('#elemToggle').removeClass('up');
} else {
$('#elemToggle').addClass('up');
$('#elemToggle').removeClass('down');
}
return false;
});
The above doesn't work since when you hit the button, technically the elem is still visible and just being collapsed. Any ideas for a workaround please?! :)
Thanks