简单的jQuery衰落序列问题 [英] Simple jQuery Fading Sequence problem

查看:52
本文介绍了简单的jQuery衰落序列问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关jQuery衰落序列的帮助.

I'm looking for a little help with my jQuery fading sequence.

我的代码:

$('#1').fadeOut('fast');
$('#1same').fadeOut('fast');
$('#fadeinme').fadeIn('slow');

我希望在第3个信号淡入之前的第一个2(#1和#1相同的淡出时间)之后增加1秒的延迟.

I'm looking to add a 1 second delay after the first 2 (#1 & #1same fade out at the same time) before the 3rd fades in.

谢谢!

推荐答案

在第一个动画完成后,我们可以使用completed回调执行fadeIn,然后使用

We can use the completed callback to execute the fadeIn after the first animation has completed, then use .delay to add the one second delay:

$('#1, #1same').fadeOut('fast', function(){
    $('#fadeinme').delay(1000).fadeIn('slow');
});

请注意,在HTML4中,id不能以数字开头.

Do note that in HTML4, ids cannot start with a number.

这篇关于简单的jQuery衰落序列问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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