Joris Ooms
Joris Ooms

Reputation: 12048

Bootstrap 2.1.1 dropdowns not working properly

I'm having trouble with my dropdowns after upgrading to Bootstrap 2.1.1.

The very first dropdown on my page works fine. Opens correctly when clicked on, then closes when clicking on either an item, the dropdown header or the page.

However, the second and third dropdowns (I'm guessing any dropdown other than the first) on my page don't work correctly.

They don't close when clicking on an item, page or their header.

I looked around for a bit and found the following snippet, which I didn't need before:

$('.dropdown-toggle').dropdown();

When I include this in my code, the second/third dropdowns do close when clicking on the page or on an item. They still don't work when clicking on their header.

The HTML for these dropdowns is exactly the same as the HTML for the first one. I can't find any differences, nor an explanation why only the first dropdown works correctly.

I have put some code on JSfiddle here: http://jsfiddle.net/3CysL/1/

Upvotes: 0

Views: 1125

Answers (1)

albertedevigo
albertedevigo

Reputation: 18411

You are linking dropdown triggers with their parent, the dropdown container.
This is breaking your triggers, so change:

href="#media"    -> href="#"
href="#tools"    -> href="#"
href="#language" -> href="#"

Upvotes: 1

Related Questions