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.

Was it helpful?

Solution

use .slideToggle() instead

$("#box").slideToggle("slow");

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top