html - Bootstrap dropdown menu - display second bootstrap navbar -
i have bootstrap 3 navbar
out of box dropdown-menu
functionality
is there way have second navbar displayed/transitioned on dropdown-toggle
of button? have nicely formatted
<nav class="navbar navbar-default"> <div class="container">
with our sub-menu items displayed. similar how www.bbc.co.uk site works when click "more" button - second centralised navbar displayed rather dropdown-menu
(and hidden when button pressed again)
bootstrap provides different built-in components can use according needs.
it has collapse component can used open , close block when click on specific element.
you can use component inside .navbar
, inside .collapse
body of component can use more .dropdown
items if want.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <nav class="navbar navbar-default"> <div class="container-fluid"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">brand</a> </div> <!-- collect nav links, forms, , other content toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="clearfix"> <ul class="nav navbar-nav"> <li class="active"><a href="#">link <span class="sr-only">(current)</span></a></li> <li><a href="#">link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">action</a></li> <li><a href="#">another action</a></li> <li><a href="#">something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">one more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="search"> </div> <button type="submit" class="btn btn-default">submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="collapse" data-target="#collapseexample" aria-expanded="false" aria-controls="collapseexample">dropdown <span class="caret"></span></a> </li> </ul> </div> <div class="collapsible-menu"> <div class="collapse" id="collapseexample"> <div class="well"> anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
Comments
Post a Comment