Javascript Jquery无法向Mozilla Firefox中的元素添加类
因此,我使用css动画和jquery addClass在单击选项卡时将动画类添加到body元素(和tab元素)。它在Chrome中运行良好,但在Firefox中只有选项卡添加了动画类 这是我的jqueryJavascript Jquery无法向Mozilla Firefox中的元素添加类,javascript,jquery,css,sass,Javascript,Jquery,Css,Sass,因此,我使用css动画和jquery addClass在单击选项卡时将动画类添加到body元素(和tab元素)。它在Chrome中运行良好,但在Firefox中只有选项卡添加了动画类 这是我的jquery $('.lightboxContentReplace').on('click', '.v4-til-tab-label', function(event) { var target = $(event.target); var targetID = target.attr('data-labe
$('.lightboxContentReplace').on('click', '.v4-til-tab-label', function(event) {
var target = $(event.target);
var targetID = target.attr('data-label');
var content = $("[data-content=" + targetID + "]");
$(".v4-til-tab-label").removeClass('tab-label-animation');
$(".v4-til-tab-content").removeClass('tab-content-animation');
target.addClass('tab-label-animation');
content.addClass('tab-content-animation');
$(".v4-til-tab-content").hide();
$("[data-content=" + targetID + "]").show(); });
这是我的css
@-webkit-keyframes tab-label-focus {
0% { top: 0;}
100% {top: -5px; border-bottom: 2px solid rgba(0, 188, 141, 0.4)}
}
@-moz-keyframes tab-label-focus {
0% { top: 0;}
100% {top: -5px; border-bottom: 2px solid rgba(0, 188, 141, 0.4)}
}
@-o-keyframes tab-label-focus {
0% { top: 0;}
100% {top: -5px; border-bottom: 2px solid rgba(0, 188, 141, 0.4)}
}
@keyframes tab-label-focus {
0% { top: 0;}
100% {top: -5px; border-bottom: 2px solid rgba(0, 188, 141, 0.4)}
}
.tab-label-animation {
-webkit-animation: tab-label-focus .25s forwards;
-moz-animation: tab-label-focus .25s forwards;
-o-animation: tab-label-focus .25s forwards;
animation: tab-label-focus .25s forwards;
outline: none;
}
@-webkit-keyframes tab-content-focus {
0% { opacity: 0;}
100% {opacity: 100%;}
}
@-moz-keyframes tab-content-focus {
0% { opacity: 0;}
100% { opacity: 1;}
}
@-o-keyframes tab-content-focus {
0% { opacity: 0;}
100% {opacity: 100%;}
}
@keyframes tab-content-focus {
0% { opacity: 0;}
100% { opacity: 1;}
}
.tab-content-animation {
-webkit-animation: tab-content-focus .75s forwards;
-moz-animation: tab-content-focus .75s forwards;
-o-animation: tab-content-focus .75s forwards;
animation: tab-content-focus .75s forwards;
}
如有任何建议,将不胜感激 尝试按Ctrl+F5键进行硬刷新。。当要求让我们尝试代码提供html文件时,您始终需要提供相关的
html、css、js…
代码