【发布时间】:2014-01-28 15:05:51
【问题描述】:
更新: 这是一个仅限 webkit 的问题。我尝试移除 translate 3d 和相对定位,但两者都没有帮助。
我有一个 2 个相互重叠的 div:一个作为 顶栏,一个作为 侧栏。 侧边栏内容旋转了90度。
我需要显示一个包含多个 div 的弹出窗口。 弹出窗口必须是侧栏的子元素。 问题是:弹出窗口将始终停留在顶部栏下方。
如果我删除 旋转变换,z-index 工作正常,但只要 rotation via css 启用,z-index完全忽略。
http://jsfiddle.net/isaraystanz/ECFpc/
html:
<div id="topbar"></div>
<div id="sidebar" class="fileRegisterbar">
<div class="fileRegisterTabs rotate90">
<div class="otrPopupWrapper fileRegisterBar">
<div id="popup"></div>
</div>
</div>
</div>
<div id="file"></div>
css:
#topbar {
background:#efefef;
height:20px;
position:absolute;
top:0;
left:0;
right:200px;
z-index:1;
}
#sidebar {
border-left:solid red 1px;
background:#ebebeb;
width:200px;
height:100%;
position:absolute;
right:0;
bottom:0;
}
#file {
position:absolute;
left:0;
right:200px;
top:20px;
bottom:0;
border-top:red solid 1px;
}
#popup:hover {
z-index: 10;
border: solid blue 2px;
}
#popup {
position:absolute;
bottom:-10px;
right: -5px;
border: solid grey 1px;
height:30px;
width: 200px;
background: white;
z-index:10;
}
.rotate90 {
-webkit-transform-origin: 0 0;
-webkit-transform: rotate(90deg);
}
【问题讨论】: