$(".test").bind("webkitAnimationEnd MSAnimationEnd OAnimationEnd animationEnd", function () {
$(this).removeClass("animate");
});
$(".test").hover(function () {
$(this).addClass("animate");
});
当您将鼠标悬停在.test
元素上时,它会添加一个animate
触发动画的类。在动画结束时,animate
该类被删除animationEnd
。
但是,如果您将鼠标悬停在动画上直到完成,然后在动画完成后取消悬停,则animate
添加另一个类...在取消悬停时再次触发动画。我不想要这个。
如何制作 jQuery,以便当您取消悬停时,它不会animate
向元素添加另一个类.test
?
另外... FireFox 不会删除 的animate
类animationEnd
,这是为什么呢?