geoffs3310
geoffs3310

Reputation: 14008

jQuery delay() not working

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

Upvotes: 1

Views: 352

Answers (3)

Sandro
Sandro

Reputation: 4771

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

No need for the second selector.

Upvotes: 0

jimplode
jimplode

Reputation: 3502

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

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

Upvotes: 0

SilentGhost
SilentGhost

Reputation: 319571

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

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

Upvotes: 2

Related Questions