开发者

Simple jQuery Fading Sequence problem

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

My Code:

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

I'm looking to add a 1 second delay a开发者_Python百科fter the first 2 (#1 & #1same fade out at the same time) before the 3rd fades in.

Thanks!


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');
});

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜