I have the following code:
$('a.btn-slide').toggle(function() {
$("#DivToSlide").slideUp("fast");
// ...
}, function() {
$("#DivToSlide").slideDown("fast");
// ...
});
Later in my code, I want to find out if #DivToSlide is in either the up or down position.
How do I do that?
Since the
slideDownfunction hides the element after it finishes, you can simply check whether the element is visible:You could also check whether
$('#DivToSlide').height()is more than some threshold.