Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
147
rated 0 times [  152] [ 5]  / answers: 1 / hits: 159916  / 15 Years ago, sun, august 9, 2009, 12:00:00

Is it possible to run two animations on two different elements simultaneously? I need the opposite of this question Jquery queueing animations.



I need to do something like this...



$('#first').animate({ width: 200 }, 200);
$('#second').animate({ width: 600 }, 200);


but to run those two at the same time. The only thing I could think of would be using setTimeout once for each animation, but I don't think it is the best solution.


More From » jquery

 Answers
53

yes there is!



$(function () {
$(#first).animate({
width: '200px'
}, { duration: 200, queue: false });

$(#second).animate({
width: '600px'
}, { duration: 200, queue: false });
});

[#98950] Thursday, August 6, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
frederickmohamedw

Total Points: 21
Total Questions: 123
Total Answers: 105

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
frederickmohamedw questions
Wed, Sep 23, 20, 00:00, 4 Years ago
Sat, Jul 18, 20, 00:00, 4 Years ago
Sun, Apr 26, 20, 00:00, 4 Years ago
Sat, Jan 11, 20, 00:00, 4 Years ago
Fri, Dec 27, 19, 00:00, 4 Years ago
;