3

我正在使用引导程序来设计我的网站。

基于这个小提琴

我把nav-static-topto 固定在上面。现在nav-collapse有很多内容,我无法浏览到最后一个菜单,因为nav-static-top它固定在顶部。有没有办法将其 nav-static-top固定在顶部并且nav-collapse内容是可滚动的,以便我可以滚动以选择内容?

我有比这样的东西,我看起来不太好,我认为 android 设备不支持 overflow:scroll

4

2 回答 2

2

找到了更好的方法。仅在 iphone 4 上测试。

@media (max-width: 767px) { 
.body-container {
    padding-top: 50px;
    margin-left:10px;
    margin-right:10px; 
}

.navbar-static-top{
    position:fixed;
    width:100%;
    z-index:1000;
}
.navbar-responsive-collapse{
    max-height: 350px;  
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch; 
    }

}
于 2013-07-12T06:31:56.520 回答
1

This doesn't completely fix your problem, but it definitely looks better if you do this:

<div class="nav-collapse collapse navbar-responsive-collapse" style="overflow-y: scroll;max-height:400px">
<ul class="nav">

instead of

<div class="nav-collapse collapse navbar-responsive-collapse">
<ul class="nav" style="overflow: scroll;max-height:400px">

I don't know about doing it on Android, but if it really doesn't work this way, you'll probably have write some JS or something.

于 2013-07-10T20:15:44.067 回答