大屏幕上的两个引导菜单崩溃问题

时间:2014-01-03 08:11:14

标签: asp.net-mvc-4 twitter-bootstrap

我在页面上有顶级菜单和左侧菜单,我希望两者都能在小屏幕上折叠,这些都适用于小型,但在大屏幕上两个菜单都不显示。

<!-- Fixed navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container nav-main">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#first">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

             <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#sidebar" role="complementary" >
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>


           <span class="navbar-brand">Business Name Test </span>
        </div>
        <div class="nav-collapse collapse" id="first">
          <ul class="nav navbar-nav navbar-right">
              <li>
                  <a href="/Settings"><span class="glyphicon glyphicon-cog"></span> Settings</a>
              </li>
              <li>
                  <a href="/Help"><span class="glyphicon glyphicon-question-sign"></span> Help</a>
              </li>
              <li>
                  <a href="/Account/LogOff"><span class="glyphicon glyphicon-log-out"></span> Logout</a>

              </li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

        <div class="container main">
            <div class="row">
                <div class="nav-collapse collapse" id="sidebar" role="complementary" >
                    <div class="m-sidebar">

    <ul class="nav">
        <li><a href="#" rel="tooltip" title="Link1">Link1</a></li>
        <li class="divider"></li>
        <li><a href="#" rel="tooltip" title="Link2">Link2</a></li>
        <li><a href="/Messages" rel="tooltip" title="Link3">Link3</a></li>
        <li class="divider"></li>
        <li><a href="/Inventory" rel="tooltip" title="Link 4">Link 4</a></li>
         <li><a href="/Inventory" rel="tooltip" title="Link 4">Link 5</a></li>
         <li><a href="/Inventory" rel="tooltip" title="Link 4">Link 6</a></li>
         <li><a href="/Inventory" rel="tooltip" title="Link 4">Link 7</a></li>

        </ul>
    </div>
                </div>
                <div class="col-md-10 col-sm-10 col-lg-10">
        <div class="page-header">
              <h1>Home Page</h1>
        </div>
                </div>
                </div>
            </div><!-- /container -->

这是Fiddle

请指导我做错了什么?

1 个答案:

答案 0 :(得分:0)

为了纠正链接的位置,我改变了导航栏元素的顺序,首先是左侧,然后是右侧(这不是问题,而是组织问题)。导航和导航之间增加了一个部门。页面标题。将左侧导航栏项的类更改为:

<ul class="nav navbar-nav navbar-left">

而不仅仅是

<ul class="nav">

以下是Final Jsfiddle:http://jsfiddle.net/FDkqT/

我知道它很简单,但如果你展开窗口,你会发现它的工作正常