我刚刚用谷歌 Chrome 桌面版和移动版测试了我的网站,似乎没有显示滑出菜单的标签。它确实有效,只是没有显示,我不知道为什么。改变位置在这里不起作用,因为我使用的滑出设计是依赖位置的,我需要它们是fixed
.
相关CSS:
#slideout #label {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
display:block;
float:right;
margin:46% 0 0 0;
padding: 0 2px 6px 2px;
font-size: 20px;
position: fixed;
left:-36px;
-webkit-transition:left 0.5s ease-in-out,opacity 0.5s ease-in-out;
-moz-transition:left 0.5s ease-in-out,opacity 0.5s ease-in-out;
-o-transition:left 0.5s ease-in-out,opacity 0.5s ease-in-out;
transition:left 0.5s ease-in-out,opacity 0.5s ease-in-out;
background-color:#fff;
border-bottom:0 !important;
border-radius:8px 8px 0 0;
}
#slideout.opened #label {
left: 86px;
}
JavaScript:
$('#label').on('click',function(){
$('#slideout').toggleClass('opened');
});
编辑:我尝试使用此代码:
#slideout #label {
position: absolute;
left: 90px;
}
#slideout {
position: relative;
}
但是发生的情况是,标签在正确的位置,但它被切断并且不可见。