Bootstrap Dropdown with Hover

Dr.Kameleon picture Dr.Kameleon · Apr 25, 2013 · Viewed 296.9k times · Source

OK, so what I need is fairly straightforward.

I have set up a navbar with some dropdown menus in it (using class="dropdown-toggle" data-toggle="dropdown"), and it works fine.

The thing is it works "onClick", while I would prefer if it worked "onHover".

Is there any built-in way to do this?

Answer

brbcoding picture brbcoding · Apr 25, 2013

The easiest solution would be in CSS. Add something like...

.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0; // remove the gap so it doesn't close
 }

Working Fiddle