jQuery animation queues

Posted by OneNerd on Stack Overflow See other posts from Stack Overflow or by OneNerd
Published on 2010-03-31T20:20:37Z Indexed on 2010/03/31 20:23 UTC
Read the original article Hit count: 510

Filed under:
|
|
|

I am at a dead end, so hoping you jQuery gurus can help.

I have a total of 10 elements (actually small images) on a page. I need to animate them like this:

  1. first 2 show up
  2. then the next 2 show up
  3. then the next 3 show up
  4. then the next 1 shows up
  5. then the last 2 show up

So, I have added attributes to each one (sequence_num = "1" (or 2 or 3 etc) so I can easily choose via the $() which ones to animate using the animate() function.)

My goal is to write a function that does the animation (I can do that - i think i have grasped the animate() function).

What I am getting stuck on is how to delay the animation so the proper groups of objects are animated in before the next group starts. I have tried the queue parameter of the animate() function, but that doesn't seem to work for what I am trying to do.

Does anyone have any experience with this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about animation