"TwentyFourteen - Search Navbar"
Bootstrap 3.1.0 Snippet by Geniusone

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container-fluid"> <nav class="navbar navbar-inverse navbar-with-search" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <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> <div class="collapse navbar-collapse" id="navbar-collapse-1"> <p class="navbar-text navbar-right" id="navbar-input-search"> <span class="glyphicon glyphicon-search"></span> </p> </div> </nav> <div id="navbar-search-panel" class="collapse"> <form class="form-horizontal" role="form"> <div class="form-group"> <div class="col-sm-12"> <input type="text" class="form-control input-lg" id="input-search" placeholder="Search .."> </div> </div> </form> </div> </div>
.navbar-with-search{ border:0; border-radius:0px; } #navbar-collapse-1{ padding-right:0; } .navbar-with-search #navbar-input-search{ background-color:green; border:15px solid green; padding:0; margin:0; color:white; } #navbar-search-panel{ margin-top:-20px; color:white; background-color:green; } #input-search{ font-size: 14px; color: rgba(255,255,255,0.8); background-color: transparent; background-image: none; padding:0 0 0 15px; border: 0; }
$(document).ready(function(){ // Set the collapse attributes for the input search in navbar $('#navbar-input-search').attr('data-toggle','collapse'); $('#navbar-input-search').attr('data-parent','#navbar-with-search'); $('#navbar-input-search').attr('href','#navbar-search-panel'); // Check the event when collapse is complete $('#navbar-search-panel').on('shown.bs.collapse', function () { $('#input-search').focus(); }); });

Related: See More


Questions / Comments: