Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How enable Hover event for bootstrap menus? [duplicate]

I implement a bootstrap responsive rich menu and it works fine. It works on Click event ,my question is : How can I change it to Hover event ?
all bootstrap menus have this issue . bootstrap doesn't have any support for this ? this is the menu I use : http://geedmo.github.io/yamm/ my problem solved with :

<style>
    li.dropdown:hover .dropdown-menu {
        display: block;
    }

    li.dropdown:hover .dropdown-toggle {
        color: #555;
        background-color: #e5e5e5;
    }
</style>

but a new problem happened , the submenus showed in the end of the menus when I shrink the browser showed in the end of the menu , and it's not appropriate :/

like image 658
shima amini Avatar asked Nov 24 '15 06:11

shima amini


1 Answers

Add this style to your page.

<style>
    li.dropdown:hover .dropdown-menu{display:block}
    li.dropdown:hover .dropdown-toggle{color:#555; background-color:#e5e5e5}
</style>

First one will enable dropdown on mouse hover and second one will change the menu header color (choose the appropriate color for your page).

like image 124
svjn Avatar answered Oct 13 '22 10:10

svjn