据我所记得,到目前为止,CSS3过渡对我来说还没有任何问题。突然(可能是由于chrome更新或对我的代码进行了其他修改),它刚刚停止在chrome(32.0.1700.77)中工作,但仍在所有其他浏览器(和旧版chrome)中运行。
@media screen and (max-width: 1325px) {
.row-offcanvas {
position: absolute;
-webkit-transition: all 0.25s ease-out;
-moz-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
width: 100%;
}
button.toggle {
display: inline-block;
}
.row-offcanvas-left,
.sidebar-offcanvas {
left: -239px;
z-index: 9999;
height: 700px;
}
.row-offcanvas-left.active {
left: 239px;
}
.sidebar-offcanvas {
position: absolute;
top: 0;
width: 239px;
}
}
我尚未对该网站的这一部分进行任何更改,也无法解释为什么它可能突然无法正常工作。转换是针对面板的,该面板在单击按钮时滑出,由这部分javascript(不负责动画)触发。
$(document).ready(function() {
$('[data-toggle=offcanvas]').click(function() {
$('.row-offcanvas').toggleClass('active');
});
});
您的问题是您尝试从未定义的属性进行动画处理:您正在更改left
为239px
,但没有像0
最初那样明确指定它。因此,默认auto
值为,没有有效的平滑过渡到的值239px
。
添加left:0
到基本定义,您就可以了。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句