开发者

jquery, how to animate element after being sure that it's not being animated at the same time

开发者 https://www.devze.com 2022-12-13 09:25 出处:网络
$(\"sth\").not(\':anim开发者_运维知识库ated\').animate(); hey is this the best way to animate element after being sure that it\'s not being animated at the same moment ?
$("sth").not(':anim开发者_运维知识库ated').animate();

hey

is this the best way to animate element after being sure that it's not being animated at the same moment ?

thanks


Depending on what you want, yes. Though I am curious what the sth selector is :)

$("#id:not(:animated)").animate(); // Is another way to write it

Or if you simply want to stop it before it animates again, use stop():

$("#id").stop().animate();
0

精彩评论

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