$(".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,这是为什么呢?