Firefox only runs the CSS animation once

依然范特西╮ 提交于 2019-12-08 06:46:15

问题


I'm building an open source tab system for beginners to start off with. I think i've found a bug in how Firefox renders CSS animations.

Tab animations only fire once in firefox

I am using Dan Edens animate.css to do the animation for each tab. Everything works fine in Chrome, and Safari however firefox only runs the animation once and then never triggers it again.

Take a look at the following demo on jsfiddle to see exactly what i'm talking about: http://jsfiddle.net/jsheffers/vqdJK/

$('#tabs li a').click(function(e){

    $('#tabs li, #content .current').removeClass('current');
    $(this).parent().addClass('current');
    var currentTab = $(this).attr('href');
    $(currentTab).addClass('current fadeInLeft');
    e.preventDefault();

});

回答1:


You forgot to remove the fadeInLeft class (fiddle).

$('#tabs li, #content .current').removeClass('current').remove('fadeInLeft');

It works then fine in Firefox!



来源:https://stackoverflow.com/questions/15092297/firefox-only-runs-the-css-animation-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!