kcssm
kcssm

Reputation: 1797

end two jquery animations simultaneously

I have two jquery animations running in two different elements. Both are triggered at the same time. Now i want to end these to animations at the same time irrespective of the durations each take to animate.

jQuery("#maindiv").animate({ scrollLeft:10 }, 500);
jQuery(".sidediv").animate({ marginLeft:-100 }, 500);

Is this possible?

Upvotes: 0

Views: 444

Answers (1)

Gabriele Petrioli
Gabriele Petrioli

Reputation: 195972

If you want to forcibly end them, use the .stop() method.

jQuery('#maindiv, .sidediv').stop();

Upvotes: 3

Related Questions