javascript - Twitter Bootstrap 3 navbar toggle button with different icon -
by using twitter bootstrap 3, want create additional navbar mobile.
in navbar put 2 toggle buttons in each side of bar. left button have classical "three bar" icon, , right button have different icon inside. want right button have ".glyphicon .glyphicon-comment" inside it. if user clicks button toggle second menu. can toggle menu icon can't changed ?
i couldn't put other icon inside right toggle button ? (i need "some link" text centered in navbar)
fiddle: http://jsfiddle.net/mavent/wpfe3/2/
<nav class="navbar navbar-inverse navbar-fixed-top visible-xs" role="navigation" id=""> <div class="navbar-header"> <button type="button" class="navbar-toggle pull-left" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <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 pull-right" data-toggle="collapse" data-target=".navbar-ex2-collapse"> <span class="sr-only">toggle navigation</span> <i class="icon-user"></i> </button> <a class="navbar-brand" style="text-align:center;" href="">some link here centered</a> </div> <div class="collapse navbar-collapse navbar-ex1-collapse"> <li class="active"> <a href="#">aaaa 1</a> </li> <li class="active"> <a href="#">aaaa 2</a> </li> <li class="active"> <a href="#">aaaa 3</a> </li> </div> <div class="collapse navbar-collapse navbar-ex2-collapse"> <li class="active"> <a href="#">bbbb 1</a> </li> <li class="active"> <a href="#">bbbb 2</a> </li> <li class="active"> <a href="#">bbbb 3</a> </li> </div> </nav>
you forget add bootstrap-glyphicons.css
in jsfiddle demo. replace
<i class="icon-user"></i>
with
<i class="glyphicon glyphicon-comment" style="color:#fff"></i>
and link in center need remove class navbar-brand
a
tag. , wrap link div , apply text-align:center
, padding
link in center.
Comments
Post a Comment