2

I read the question on how to get the dropdown to open on hover which was an excellent fix, however I would like to get the nav li to keep "open" class when going down into "dropdown-menu" ul. Here is a jsfiddle http://jsfiddle.net/someyoungideas/29txm/ for my problem.

<div class="navbar">
    <div class="navbar-inner">
        <ul class="nav">
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">Help</a>
                    <ul class="dropdown-menu">
                        <li><a href="#">New Item</a></li>
                    </ul>                        
            </li>
        </ul>
    </div>
</div>​
someyoungideas
  • 259
  • 5
  • 16

1 Answers1

1

One way to address your concern is to make use of the twitter-bootstrap-hover-dropdown plugin found on github. The plugin is also one of the answers in the old question: https://stackoverflow.com/a/12851616/538962.

Note the use of data-hover="dropdown" to call the plugin.

<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" 
data-delay="1000" data-close-others="false">Help</a>

Here is a working sample:
http://jsbin.com/xuwokuva/1

Community
  • 1
  • 1
mg1075
  • 17,985
  • 8
  • 59
  • 100
  • The plugin seems to be broken now? jsfiddle doesn't work either. But I found another workaround at http://stackoverflow.com/questions/8878033/how-to-make-twitter-bootstrap-menu-dropdown-on-hover-rather-than-click/12851616#12851616 which is simple and effective. – newman Jul 26 '14 at 20:52
  • @miliu - I have removed the reference to the old jsfiddle example and updated to a jsbin example using the latest version of the plugin and of bootstrap. Hover over the "dropdown" links, and you should be able to see the effect at work. – mg1075 Jul 26 '14 at 22:09