soundasleep / jquery-dropdown

Bootstrap-style dropdowns with some added features and no dependencies.
Other
767 stars 268 forks source link

Dropdown menu on button does not close #43

Closed ekiruluta closed 10 years ago

ekiruluta commented 10 years ago

I implemented the dropdown as a button but when I click the button and select a menu item the dropdowm does not go away. What am I missing?

claviska commented 10 years ago

Hard to say without seeing some code. Feel free to post a Fiddle.

ekiruluta commented 10 years ago

Here is the example code:

Setting up drop down menu...

<div id="dropdown-1" class="dropdown dropdown-tip">
    <ul class="dropdown-menu">
    <li onclick="show1()"><a href="#">Find Set 1...</a></li>
    <li class="dropdown-divider"></li>
    <li><a href="show2()">Find Set 2...</a></li>
    <li><a href="show3()">Find Set 3...</a></li>
    <li class="dropdown-divider"></li>
    <li><a href="show4()">Find Set 4...</a></li>
    <li><a href="show5()">Find Set 5...</a></li>
    </ul>
</div>

Activating drop down menu using a button...

<button name=\"menuOps\" data-dropdown=\"#dropdown-1\" />Menu Options</button>

The menu is displayed correctly when you click the button but when I select an item the menu items remain on the screen. How do I close it?