views:

83

answers:

2
<js> $("#curtain").slideUp("slow"); $("#curtain").slideDown("slow"); </js>

Now what do I do, if I want to add a delay of 100ms between the .slideUp and slideDown?

A: 

You can have it call a function when it completes an animation. Have a function called after the slideup, use a timer to wait 100ms, then call the slidedown

Jay
A: 

Since jQuery 1.4, it's as easy as

$("#curtain").slideUp("slow").delay(500).slideDown("slow");

On older version you had to use the animation callback and setTimeout:

$("#curtain").slideUp("slow", function(){
  setTimeout(function(){ $("#curtain").slideDown("slow"); }, 500);
});
Kobi