问题描述
这很奇怪.我有一个div,我希望该div在5秒内向下滑动.所以我正在使用此脚本:
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);
如果我使用.delay(5000)
,则动画完全不起作用.但是如果我使用
If I use .delay(5000)
the animation doesn't work at all. But if I use
$('.land_leadform').hide(0).slideDown(5000);
它工作正常.
.delay
不起作用的原因可能是什么?这是已知问题还是什么?
What could be the reason for .delay
not to work? Is this a known issue or something?
推荐答案
.delay
仅在处理动画队列时有效.不带参数的.hide()
和.show()
不会与动画队列交互.通过在.delay()
之前添加.hide(1)
和.show(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.
这篇关于jQuery .delay不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!