I've been trying to pick apart the fzqueue plugin and the code Erik wrote, but unfortunately I can't figure out how it actually works. It seems that it's based around anarray that's being used as a FIFo structure, but how the code knows that one animation has ended is a total mystery to me.
In reflection, I think what I need is a queue into which classes of animations can be inserted. All the animation events in a class get executed together, but each class in the queue is executed one after the other. Maybe something like this: animQueue.addClass ('hideClass'); animQueue.addAnim ('hideClass', $('.toHide').fadeOut ('slow')); animQueue.addClass ('moveClass'); $('.moveClass').each (function (){ animQueue.addAnim ('moveClass', $(this).animate ({ top: Math.floor (Math.random () * 1000), left: Math.floor (Math.random () * 1000) },'slow')); }); animQueue.addClass ('showClass'); animQueue.addAnim ('showClass', $('.toShow').fadeIn ('slow')); animQueue.execute (); Hopefully the syntax above will give you an idea of what I'm thinking. I just wish I knew how to implement something like that. :) On May 24, 11:47 am, Gordon <[EMAIL PROTECTED]> wrote: > I've already posted on this topic before, but I really am gettign > quite desperate as the project deadline looms and I still don't have a > solution. > > I need several animations to happen, but I need them to happen in > sequence rather than all at once (first animation: hide unselected > items. Second animation: Move visible items to new locations to > occupy space taken by unselected items/make space for currently hidden > selected items. Third animation: Reveal currently hidden selected > items). > > I tried using the callback method, but this has a serious drawback for > my purposes, in that if one of the animations in the chain doesn't > occur (because no items were unselected but some new ones were > selected, for example) then all subsequent animations don't occur > either. If a jQuery selector returns 0 results then applied effects > aren't executed. > > What I need is some code that will ececute my animations one after the > other, but which doesn't depend on all animations in the chain being > triggered for the subsequent animations to play. Is there a plugin > for doing this? Or is it slated as a new feature for jQuery? Or has > anyone else come up with a solution to the problem? > > Sorry to keep asking this but like I said, it's getting pretty urgent.