UserIsCorrupt
UserIsCorrupt

Reputation: 5025

Preventing queuing during multiple .animation events

$(this).animate({'backgroundColor':'red'},600)
       .animate({'color':'#fff'},600);

How can I make both .animate events happen at the same time instead of the second one waiting for the first one to complete?

Upvotes: 1

Views: 53

Answers (2)

veeTrain
veeTrain

Reputation: 2915

You should be able to specify multiple things that change in your animate statement.

$(this).animate({
    'backgroundColor':'red',
    'color':'#fff'
} ,600);

It's right there in the documentation for .animate().

Upvotes: 0

David Hedlund
David Hedlund

Reputation: 129792

By specifying them in the same animate call:

$(this).animate({
   'backgroundColor':'red',
   'color':'#fff'
},600);

Upvotes: 2

Related Questions