0

This is very weird. I have a div and I want that div to slideDown in 5 seconds. So I'm using this script:

$('.land_leadform').hide(0).delay(5000).slideDown(5000);

If I use .delay(5000) the animation doesn't work at all. But if I use

$('.land_leadform').hide(0).slideDown(5000);

it works fine.

What could be the reason for .delay not to work? Is this a known issue or something?

4
  • hide() is not an animation.. delay can only be used for animations Commented Nov 15, 2012 at 5:32
  • Seems to work as expected: jsfiddle.net/w2fCX Commented Nov 15, 2012 at 5:32
  • your first code is working absolutely fine and i had no issues with that whatsoever.see this here: jsbin.com/oliqod/1/edit Commented Nov 15, 2012 at 5:37
  • @kayen: Your link does not work properly, due to configuration. See fixed version: jsfiddle.net/w2fCX/1 Commented Nov 15, 2012 at 5:42

1 Answer 1

1

.delay only works when you're dealing with the animation queue. .hide() and .show() without arguments don't interact with the animation queue. By adding the .hide(1) and .show(1) before the .delay() makes the slide animations wait on the queue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.