【发布时间】:2013-01-16 11:39:38
【问题描述】:
我正在尝试使用图像和菜单链接下的引导菜单,当它滚动时,菜单会停留在窗口顶部。
我发现了有趣的引导词缀并使用了这个线程中的内容: bootstrap-affix : Div underneath affix "jumps" to top. How do I make it smoothly scroll behind?
问题是当我按下菜单按钮时,选项位于页面内容文本下方。
我已经为你写了一个小提琴来看看我的问题并尝试解决方案: http://jsfiddle.net/mram888/WnPqF/
我尝试为我的菜单 div 类设置不同的 z-index,但只有在页面滚动且菜单贴在顶部时才能正常工作。
#nav.affix {
position: fixed;
top: 0;
width: 100%;
z-index:2;
}
#nav > .navbar-inner {
border-left: 0;
border-right: 0;
border-radius: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
}
.nav-wrapper {
z-index: 2;
}
【问题讨论】: