我在粘性菜单的动画有问题。 CSS被改变了,但没有转换。任何人都有一个想法,为什么?在粘性菜单css过渡不起作用
$(window).scroll(function() {
if ($(this).scrollTop() > 50) {
$('.navbar-fixed-top').addClass("navbar-fixed-top-sticky");
} else {
$('.navbar-fixed-top').removeClass("navbar-fixed-top-sticky");
}
});
和CSS:
.navbar-fixed-top {
transition: 0.3 all ease;
-webkit-transition: 0.3 all ease;
}
.navbar-fixed-top.navbar-fixed-top-sticky {
background: #601a36;
height: 80px;
transition: 0.3 all ease-in-out;
-webkit-transition: 0.3 all ease-in-out;
}
哪个过渡不工作?您不能从'auto'或从未声明的值转换, –
您至少应该添加注释,以便您不接受答案! @Neuropeptidula – eisbehr