jQuery: The Write Less, Do More JavaScript Library

Animation queue on different element?

View: New views
2 Messages — Rating Filter:   Alert me  

Animation queue on different element?

by badtant-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I have the two animations below running side by side:
$("#dubbelsnurra #graph1").animate({height:"154px"},1500);
$("#dubbelsnurra #graph2").animate({height:"74px"},1500);

When they are "done" I want to start another animation on two other
elements. See below:
$("#dubbelsnurra #graph1_result,#dubbelsnurra #graph2_result").fadeIn
(500);

What I can't figure out is how to set them on queue? I know there is
queing available in the animate function but that seems to be when you
have different animations on the same elements.

How to I do this?

Thanks

Re: Animation queue on different element?

by Michel Belleville :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use the animations complete callbacks.

$('#element1').fadeIn('slow', function() { $('#element2').fadeIn('slow', function() { ... }); });

Michel Belleville


2009/11/11 badtant <badtant@...>
Hi!

I have the two animations below running side by side:
$("#dubbelsnurra #graph1").animate({height:"154px"},1500);
$("#dubbelsnurra #graph2").animate({height:"74px"},1500);

When they are "done" I want to start another animation on two other
elements. See below:
$("#dubbelsnurra #graph1_result,#dubbelsnurra #graph2_result").fadeIn
(500);

What I can't figure out is how to set them on queue? I know there is
queing available in the animate function but that seems to be when you
have different animations on the same elements.

How to I do this?

Thanks