I am trying to use a simple dropdown button from the Twitter Bootstrap. However, it's isn't showing the dropdown options. The code is below and here is a link to a fiddle: http://jsfiddle.net/nunos/DjHyQ/11/
EDIT: found out the problem. I was including the bootstrap.js
in the <head>
. Once I changed that line to the <body>
as the Twiiter Bootstrap Documentation actually says, it worked right away. I never thought there was a difference in scripts being included in the <head>
or in the <body>
. Now I know!
<div class="btn-toolbar" style="margin: 0;">
<div class="btn-group">
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
</div>
Well, the fiddle you posted isn't working because you have not selected jquery (which is required for bootstrap widgets) as your framework (the selection box is on the sidebar on the right hand side of the page). Are you loading jquery in your actual code?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With