jQuery Sliding a div
<p>I want to slide a div up, and after it has slided up completely, I want to slide the other <code>&lt;div&gt;</code> down (which is by default hidden).</p>

<p>I am trying following code, it does what I want, but I only don't get the effect that the div slides down after the first has slided up completely, it looks like the div starts appearing as soon the other div starts sliding above.</p>

<p>So how can I make it wait till the first div slides up completely and then it starts sliding down.</p>

<p><strong>HTML:</strong></p>

<pre><code>&lt;div class="box"&gt;
    &lt;div class="up"&gt;&lt;/div&gt;
    &lt;div class="down"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;a href="#" id="hidediv"&gt;Hide me&lt;/a&gt;
</code></pre>

<p><strong>CSS:</strong></p>

<pre><code>.up{
    width: 100px;
    height: 100px;
    background: orange;
    display: block;
}

.down{
    width: 100px;
    height: 100px;
    background: red;
    display: none;
}
</code></pre>

<p><strong>jQuery:</strong></p>

<pre><code>$("#hidediv").click(function () {
  $(".up").slideUp(800);
  $(".down").slideDown(800);
}); 
</code></pre>

<p><strong>Demo:</strong></p>

<p><a href="http://jsfiddle.net/hFyvw/" rel="nofollow">http://jsfiddle.net/hFyvw/</a></p>
