"Nav Bar with Popup Sign in"
Bootstrap 3.0.0 Snippet by ashutosh123

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.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"> <div class="row"> <div class="col-md-12"> <nav class="navbar navbar-default" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-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="http://www.jquery2dotnet.com">Brand</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="http://www.jquery2dotnet.com">Home</a></li> <li><a href="http://www.jquery2dotnet.com">About Us</a></li> <li class="dropdown"> <a href="http://www.jquery2dotnet.com" class="dropdown-toggle" data-toggle="dropdown">Pages <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="http://www.jquery2dotnet.com">Action</a></li> <li><a href="http://www.jquery2dotnet.com">Another action</a></li> <li><a href="http://www.jquery2dotnet.com">Something else here</a></li> <li class="divider"></li> <li><a href="http://www.jquery2dotnet.com">Separated link</a></li> <li class="divider"></li> <li><a href="http://www.jquery2dotnet.com">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left" role="search"> <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="http://www.jquery2dotnet.com">Sign Up</a></li> <li class="dropdown"> <a href="http://www.jquery2dotnet.com" class="dropdown-toggle" data-toggle="dropdown">Sign in <b class="caret"></b></a> <ul class="dropdown-menu" style="padding: 15px;min-width: 250px;"> <li> <div class="row"> <div class="col-md-12"> <form class="form" role="form" method="post" action="login" accept-charset="UTF-8" id="login-nav"> <div class="form-group"> <label class="sr-only" for="exampleInputEmail2">Email address</label> <input type="email" class="form-control" id="exampleInputEmail2" placeholder="Email address" required> </div> <div class="form-group"> <label class="sr-only" for="exampleInputPassword2">Password</label> <input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password" required> </div> <div class="checkbox"> <label> <input type="checkbox"> Remember me </label> </div> <div class="form-group"> <button type="submit" class="btn btn-success btn-block">Sign in</button> </div> </form> </div> </div> </li> <li class="divider"></li> <li> <input class="btn btn-primary btn-block" type="button" id="sign-in-google" value="Sign In with Google"> <input class="btn btn-primary btn-block" type="button" id="sign-in-twitter" value="Sign In with Twitter"> </li> </ul> </li> </ul> </div> <!-- /.navbar-collapse --> <button class="btn btn-primary btn-lg" href="#signup" data-toggle="modal" data-target=".bs-modal-sm">Sign In/Register</button> </nav> </div> </div> <!-- Modal --> <div class="modal fade bs-modal-sm" id="myModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <br> <div class="bs-example bs-example-tabs"> <ul id="myTab" class="nav nav-tabs"> <li class="active"><a href="#signin" data-toggle="tab">Sign In</a></li> <li class=""><a href="#signup" data-toggle="tab">Register</a></li> <li class=""><a href="#why" data-toggle="tab">Why?</a></li> </ul> </div> <div class="modal-body"> <div id="myTabContent" class="tab-content"> <div class="tab-pane fade in" id="why"> <p>We need this information so that you can receive access to the site and its content. Rest assured your information will not be sold, traded, or given to anyone.</p> <p></p><br> Please contact <a mailto:href="JoeSixPack@Sixpacksrus.com"></a>JoeSixPack@Sixpacksrus.com</a> for any other inquiries.</p> </div> <div class="tab-pane fade active in" id="signin"> <form class="form-horizontal"> <fieldset> <!-- Sign In Form --> <!-- Text input--> <div class="control-group"> <label class="control-label" for="userid">Alias:</label> <div class="controls"> <input required="" id="userid" name="userid" type="text" class="form-control" placeholder="JoeSixpack" class="input-medium" required=""> </div> </div> <!-- Password input--> <div class="control-group"> <label class="control-label" for="passwordinput">Password:</label> <div class="controls"> <input required="" id="passwordinput" name="passwordinput" class="form-control" type="password" placeholder="********" class="input-medium"> </div> </div> <!-- Multiple Checkboxes (inline) --> <div class="control-group"> <label class="control-label" for="rememberme"></label> <div class="controls"> <label class="checkbox inline" for="rememberme-0"> <input type="checkbox" name="rememberme" id="rememberme-0" value="Remember me"> Remember me </label> </div> </div> <!-- Button --> <div class="control-group"> <label class="control-label" for="signin"></label> <div class="controls"> <button id="signin" name="signin" class="btn btn-success">Sign In</button> </div> </div> </fieldset> </form> </div> <div class="tab-pane fade" id="signup"> <form class="form-horizontal"> <fieldset> <!-- Sign Up Form --> <!-- Text input--> <div class="control-group"> <label class="control-label" for="Email">Email:</label> <div class="controls"> <input id="Email" name="Email" class="form-control" type="text" placeholder="JoeSixpack@sixpacksrus.com" class="input-large" required=""> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="userid">Alias:</label> <div class="controls"> <input id="userid" name="userid" class="form-control" type="text" placeholder="JoeSixpack" class="input-large" required=""> </div> </div> <!-- Password input--> <div class="control-group"> <label class="control-label" for="password">Password:</label> <div class="controls"> <input id="password" name="password" class="form-control" type="password" placeholder="********" class="input-large" required=""> <em>1-8 Characters</em> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="reenterpassword">Re-Enter Password:</label> <div class="controls"> <input id="reenterpassword" class="form-control" name="reenterpassword" type="password" placeholder="********" class="input-large" required=""> </div> </div> <!-- Multiple Radios (inline) --> <br> <div class="control-group"> <label class="control-label" for="humancheck">Humanity Check:</label> <div class="controls"> <label class="radio inline" for="humancheck-0"> <input type="radio" name="humancheck" id="humancheck-0" value="robot" checked="checked">I'm a Robot</label> <label class="radio inline" for="humancheck-1"> <input type="radio" name="humancheck" id="humancheck-1" value="human">I'm Human</label> </div> </div> <!-- Button --> <div class="control-group"> <label class="control-label" for="confirmsignup"></label> <div class="controls"> <button id="confirmsignup" name="confirmsignup" class="btn btn-success">Sign Up</button> </div> </div> </fieldset> </form> </div> </div> </div> <div class="modal-footer"> <center> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </center> </div> </div> </div> </div> </div>
body { margin-top:30px; } #login-nav input { margin-bottom: 15px; }
$(document).ready(function(){ //Handles menu drop down $('.dropdown-menu').find('form').click(function (e) { e.stopPropagation(); }); });

Related: See More


Questions / Comments: