Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows Twitter Bootstrap's native support for uncollapsible dropdowns in versions >= 2.0.3.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<title>Bootstrap >= 2.0.3</title>
</head>
<body>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-bar"></i>
<i class="icon-bar"></i>
<i class="icon-bar"></i>
</a>
<a class="brand" href="#">Bootstrap >= 2.0.3</a>
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
</ul>
</li>
</ul>
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
@tfausak

This comment has been minimized.

Copy link
Owner Author

commented Jul 17, 2013

Sorry about that! This example is for Twitter Bootstrap >= 2.0.3. You can find the CSS and JS files on Bootstrap's GitHub page: https://github.com/twitter/bootstrap/tree/v2.0.3

If you want to directly download them from somewhere, try BootstrapCDN. The closest version they have is 2.0.4:

I'm not sure which version of jQuery those versions of Bootstrap are meant to work with, but you should be able to use 1.10.2: http://code.jquery.com/jquery-1.10.2.min.js

@haran2000

This comment has been minimized.

Copy link

commented Jun 23, 2014

Hi tfausak, what about bootstrap 3? I'm trying to use your code under the third release of bootstrap but it can't works. Do you think it is possible to let it works? thank you

@rtpHarry

This comment has been minimized.

Copy link

commented Aug 27, 2014

It looks like in Bootstrap 3 you can just remove the .collapse class and hide the button. I just have one item in my menu you though so might have to tweak further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.