jQuery slideUp div if already slided down?
-
14-10-2019 - |
Question
I have a simple question about jquery slideDown, SlideUp. I'm using slideDown to slide a div on click, like
$("#box").slideDown("slow");
How can I do it so that if the #box is already slided down, it should slide up by clicking again? Thanks.
Solution
use .slideToggle() instead
$("#box").slideToggle("slow");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow