tags:

views:

17

answers:

3

Hi, I have a div with an id of dropdown. I want it to drop down for 5 seconds then go back up again but I can't get the delay to work properly. It comes down but doesn't go back up again. Here is what I have:

$('#dropdown').slideDown().delay(5000).('#dropdown').slideUp()

Any help much appreciated thanks

+2  A: 

You don't need a second ('#dropdown') as you're still operating on the same object.

$('#dropdown').slideDown().delay(5000).slideUp()
SilentGhost
A: 
$('#dropdown').slideDown().delay(5000).slideUp()

^^ this, you do not need to use the id again.

jimplode
A: 
$("#dropdown").slideUp().delay(1000).slideDown();

No need for the second selector.

Sandro
there are two answers with the exactly same code posted 6-7 minutes before yours, why did you decide to post this?
SilentGhost
I had begun answering the question less than a minute after the original post, but decided to double-check the code on jsbin before hitting post. :) Due diligence got the best of me.
Sandro