2015-09-26 212 views
2

我使用的是Bootstrap 3,我想創建一個側欄,就像在移動應用程序中出現的那樣,最初隱藏它們並在點擊時從左到右出現。Bootstrap將導航欄轉換爲側欄

以下使用引導程序的html會創建一個導航欄,它在較小的設備上變爲可摺疊圖標。在點擊圖標時,菜單從上到下出現。引導程序是否提供了改變轉換方向的功能?請幫幫忙,我是新來的CSS和引導

<nav class="navbar navbar-inverse"> 
 
    <div class="container-fluid"> 
 
     <div class="navbar-header pull-left"> 
 
\t <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> 
 
     <span class="icon-bar"></span> 
 
     <span class="icon-bar"></span> 
 
     <span class="icon-bar"></span>       
 
     </button> 
 
    </div> 
 
\t <a class="navbar-brand" href="#">Demo</a> 
 
    <div class="collapse navbar-collapse" id="myNavbar"> 
 
     <ul class="nav navbar-nav"> 
 
     <li class="active"><a href="#">Home</a></li> 
 
     <li class="dropdown"> 
 
      <a class="dropdown-toggle" data-toggle="dropdown" href="#">City <span class="caret"></span></a> 
 
      <ul class="dropdown-menu"> 
 
      <li><a href="#"></a></li> 
 
      <li><a href="#">Pune</a></li> 
 
      <li><a href="#">Hyderabad</a></li> 
 
      </ul> 
 
     </li> 
 
     <li><a href="#">menu item</a></li> 
 
     <li><a href="#"></a></li> 
 
     </ul> 
 
     <ul class="nav navbar-nav navbar-right"> 
 
     <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li> 
 
     <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li> 
 
     </ul> 
 
    </div> 
 
    </div> 
 
</nav>

回答