I'm trying to find out how to queue animations on multiple elements using jQuery.
For example, I need to move on element across the screen. Then when that is done, move the next one, etc.
This of perhaps a list of items.. that fall into place.. one by one.
Can somebody help me out?
Do I need to resort to using the onComplete functions of each animation to start the next one?
Update: simple example.
<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li><li>Item 4</li></ul>
I want to make each of them fade in one by one. SO Item 1 fades in. Then when that is done, Item 2 fades in and so forth.
I'm converting some Flash "page build" type animations to HTML using jQuery. So I need to queue animations on multiple elements. Like make a box appear, and the slide some text onto it.. etc..
Actually all of jQuerys
fx methods
(including.animate()
) offer acomplete callback
. That is when you need to execute some non-fx stuff after an animation has completed.If you just want to have different
fx
effects executing in order, it's enough to chain the methods likejQuery will automatically take care of you in this spot. This is translated into a call like
update
In reference to your comment, enter this into your firebug or webkit console:
This would work on some upper div elements from the Stackoverflow side.