But It would probably be better changing the class instead of the id.


On 21 Feb., 15:42, "paul.mac" <paul.mcma...@uuconstruct.co.uk> wrote:
> Thanks - would it not be easier to set up a loop that is executed
> after all the animations have been finished? As I have 8 numbered form
> 0 to 8, will there not be a conflict when you end up with 2 objects
> with id1?
>
> Thanks
>
> paul
>
> On Feb 21, 2:29 pm, Thomas Jaggi <thomas.ja...@gmail.com> wrote:
>
> > You could use the callback function (http://docs.jquery.com/Effects/
> > animate#paramsdurationeasingcallback).
>
> > $("#right").click(function(){
> >     $("#i1").animate({width: '98px', "left": "+=86px"}, 1500, function
> > (){
> >         var id = $(this).attr('id').split('i')[1];
> >         id = id -1;
> >         $(this).attr('id',id)
> >     });
>
> > })
>
> > On 21 Feb., 15:15, "paul.mac" <paul.mcma...@uuconstruct.co.uk> wrote:
>
> > > Hi,
>
> > > I have a group of animations, which once they are finished I would
> > > like to change all the image ids and then the src attribute. My code
> > > is as follows:
>
> > >    $("#right").click(function(){
> > >       $("#i0").fadeIn(1500);
> > >       $("#i1").animate({width: '98px', "left": "+=86px"}, 1500);
> > >       ...
> > >       $("#i6").animate({width: "75px", left: "+=110px"}, 1500);
> > >       $("#i7").fadeOut(1500);
> > >     })
>
> > > I don't know how to string a function to this above one so that it
> > > executes after all the animations have finished. Basically I want to
> > > take the existing ids ( i1, i2 ... and change and change them to i0,
> > > i1 etc.
>
> > > Thanks in advance
>
> > > paul

Reply via email to