1

I'm using bootstrap to generate html horizontal menu

<div class="btn-group"">             
    <div class="btn-group">
        <button type="button" data-toggle="dropdown" class="btn btn-inverse dropdown-toggle">About Us<span class="caret"></span></button>
        <ul class="dropdown-menu">
           <li><a href="/a/">Submenu 1</a></li>
           <li><a href="/b/">Submenu 2</a></li>
        </ul>
    </div>
</div>

This works on click, how can I rework this to change behaviour, to show submenu items menu on hover instead of click ?

1 Answer 1

5

Add this css

.btn-group:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}
Sign up to request clarification or add additional context in comments.

3 Comments

this opens all submenu items, what if I have more than one main menu?
Give each menu a unique class class="dropdown-menu dd-about" also each button needs to be in a uniquely classed div like about-btn
Hey, this works for me with a little changes. Thanks. I have a problem, with hovering, clicking is still working, don't want click to work...only hover.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.