Ok, but how do I animate multiple all items with the same class instantaneously?
Thanks On Oct 9, 10:28 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Simplest way might be to assign a class to each of them. This way you can > reference them individually by ID or as part of a group by classname. Or put > them all in a parent container and reference them with child selectors: > > $('#container div') > > andy > > -----Original Message----- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of petrozza > Sent: Tuesday, October 09, 2007 9:17 AM > To: jQuery (English) > Subject: [jQuery] animating multiple items at the same time > > Hi! I am relatively new to jQuery and recently ran into the following > problem. Let's say I have a few DIVs of the same dimensions on top of each > other. I need to expand/shrink them at the same time. I tried running a loop > through these DIVs and doing something like: > > for(i=0;i<5;i++){ > $('#divid'+i).animate({width: 400}, 'slow'); } > > this works but the animations don't occur at exactly the same time for each > element (loop delay obviously). Is there a way to make all animations start > at the same time? > > Thanks