animate.css运行功能后才animate.css removeClass过渡完成
我不知道如何把这个,但我有类似下面的代码:JSFiddle
$("#btn1").click(function(){
$('#test1').addClass('animated infinite pulse tada');
$('#test2').addClass('animated infinite pulse tada');
$('#test3').addClass('animated infinite pulse tada');
});
$("#btn2").click(function(){
$('button').removeClass('animated infinite pulse tada');
$('#test1').addClass('animated infinite pulse tada');
$('#test2').addClass('animated infinite pulse tada');
$('#test3').addClass('animated infinite pulse tada');
$('#test5').addClass('animated infinite pulse tada');
});
为什么在动画成为如果我在按钮1之后点击按钮2,那么这种混乱?是否因为在执行removeClass时它也具有转换速度?如果是这样,我怎样才能在转换完全停止后才添加类?或者至少立即停止动画。
是的,这是有效的,但这是唯一的方法?无论如何,无论如何感谢 –
这是不是一个很好的解决方案,许多原因,setTimeout并不需要在确切的时间开火,只有最少的时间指定。如果更改持续时间,还需要在两处更改代码?这根本不健壮。再加上如果你不知道另一个解决方案,你不应该说它是唯一的解决方案,因为有一个解决方案。 – Bamieh