开发者

end two jquery animations simultaneously

开发者 https://www.devze.com 2023-01-25 23:13 出处:网络
I have two jquery animations r开发者_开发问答unning 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

I have two jquery animations r开发者_开发问答unning 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?


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

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

精彩评论

暂无评论...
验证码 换一张
取 消