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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<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>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
body { margin-top:30px; }
#login-nav input { margin-bottom: 15px; }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
$(document).ready(function(){
//Handles menu drop down
$('.dropdown-menu').find('form').click(function (e) {
e.stopPropagation();
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

how to download this??

Auba Meyeng () - 8 years ago - Reply 0


O botão "sign in" não mostra o formulário de login

Marcelo Moreira () - 9 years ago - Reply 0


does not work in IE 9

Luis Fernando Mangia () - 9 years ago - Reply 0


Doesn't work ?

webbeur () - 10 years ago - Reply 0


I have problem on Google chrome. I hover on "Sign in " button and after that login form visible.

Mohammad Ashabi () - 10 years ago - Reply 0


Even better with JSF, can use partial update/logon to modify the sign in form thus not needing the propagation stopper in javascript :)

John Redwood () - 10 years ago - Reply 0


This doesn't work consistently for me unless I add this to the javascript $(document).ready - $('.dropdown-toggle').dropdown();

James O'Brien () - 11 years ago - Reply 0


I'm trying to use this with the Social Buttons (http://lipis.github.io/boot..., but the CSS is all screwed up. Anybody else having this problem. Check out www.mywebwishlist.com for an example.

Drew () - 11 years ago - Reply 0


it seems putting it in the navbar messes things up. You'll need to adjust the color and padding for the buttons that are in .nav class.

maxsurguy () - 11 years ago - Reply 0


This snippet is not compatible with ie8 or less. I dont know about ie9+. Not even with the css3mediaqueires.js loaded.

mike () - 11 years ago - Reply 0


Hi Bhaumik, Thanks for making this available to us. Was wondering if you have any idea on how to make this look modal, even though it is not. I will like to focus all user attention on the login screen and fade everything else until that is done. would appreciate any help in getting that done.

otomori () - 11 years ago - Reply 0


So I'm trying to incorporate this into my Rails 4 application but the drop down does't seem to work. When I click on the Sign in button, the drop down doesn't appear. I appended the CSS to my custom.css.scss file and I added the JS to application.js. Is there something I'm doing wrong?

anirudhgm () - 11 years ago - Reply 0


Try adding this to the JS $(document).ready
$('.dropdown-toggle').dropdown();

James O'Brien () - 11 years ago - Reply 0


nnmm,nmn

nnbm () - 7 years ago - Reply 0


Did you add bootstrap.js in javascripts folder??

Djessy Menard () - 11 years ago - Reply 0


Can someone create a Drop-up menu for the footer?

Mounssif () - 11 years ago - Reply 0


I did one, snippet is awaiting moderation. :)

Alex () - 11 years ago - Reply 0


Thank you Bhaumik! :)

Alex () - 11 years ago - Reply 0