Reputation: 2204
Why does the animate wait for the fadeIn to complete before it executes, can anyone shed some light for me please?
//Price Navigation FadeIn
$('#header-base > ul').hide().css({'top':'50px'});
$('#header-base > ul').fadeIn(500);
$('#header-base > ul').animate({'top':'0px'});
I want the fadeIn and animate to happen simultaneously.
Upvotes: 2
Views: 831
Reputation: 237855
The problem is that animations are automatically put in the effects queue. You can alter this by supplying a queue
setting:
$('#header-base > ul').animate({top: '0px'}, {queue: false});
See the animate
API.
Upvotes: 4
Reputation: 8942
Not sure why they don't happen at the same time, but a quick fix is to just
Perhaps something like...
$('#header-base > ul').css({'top':'50px', 'opacity':'0'});
$('#header-base > ul').animate({top:'0px', opacity: 100}, 500);
Upvotes: 0