jQuery .delay不起作用 [英] jQuery .delay doesn't work

查看:220
本文介绍了jQuery .delay不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这很奇怪.我有一个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不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆