Dropdown.js
I know this has been discussed before, but the dropdown functionality is either broken or mis-documented. It's not even possible to get the dropdown sample working correctly by copying & pasting. That is a big problem. I've tried searching the docs, applying fixes, etc. but to no avail. Even copying the samples verbatim doesn't work. Please fix this documentation issue so we can all bask in the glory of this app.
Before you ask, I've literally tried everything mentioned in the issues list and via Google and nothing works--I literally cannot reproduce even the demo application.
thanks, Chris
I included the bootstrap-dropdown.js file and added data-dropdown="dropdown" to an li class="dropdown" element and it worked fine. Are you getting JS errors in the console?
Sorry to hear you're having problems, can you create a jsfiddle of it not working?
Not sure how much of a sample I can give. Here's what I've done:
- Include bootstrap-dropdown.js in head
- included HTML
- At end of HTML include js
Here's the HTML (a slightly customized version of the stock sample -- using ASP.NET MVC):
At the end of the file:
sorry, github destroyed my markup
Here's the markup in jsfiddle: http://jsfiddle.net/cpherjennings/FBP66/
You need to include the bootstrap-modal.js file on your page. It doesn't appear to be in your fiddle...
When I change the stylesheet link for bootstrap to <link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css"> and run it in jsfiddle, the dropdown works fine. Clicking on admin opens a menu with change password.
What browser are you using?
oh nice catch jacob! works for me too
I figured out what was happening. In my code sample I left out the code that loads a flex app (via swfobject.js). The top navigation bar sits immediately on top of the flex app. So, when clicking the dropdown link, the part that drops down is being obscured by the flex app. I've tried changing the z-index value of the "li" in the dropdown but that doesn't seem to help. Still working on this... But at least I was able to get the dropdown working out of the box. Thanks!
So, with a swf, you need to set the WMode to transparent (it's a flash var) in order to allow HTML to appear on top of it.
awesome good to hear!
Holy shit, you are a life-saver, Jacob. Bonus points to you. That works fabulously. After researching this, I can't believe I didn't figure that out, but normally our Flex apps don't co-mingle with HTML (i.e. they're full-screen). Nice catch!