How can I make the hover state remain for at least 1 second? Currently it is difficult to select the sub menu items as the hover state disappears too soon.
Here is the jsFiddle.
My HTML:
<div class="container">
<div class="row">
<div class="col-md-12">
<div>
<span>Logo+Text</span>
</div>
<div class="btn-group has_dropdown" style="margin-left: 200px">
<a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Lists</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">Sub List 1</a>
</li>
<li>
<a href="#">Sub List 2</a>
</li>
<li>
<a href="#">Sub List 3</a>
</li>
<li>
<a href="#">Sub List 4</a>
</li>
<li>
<a href="#">Sub List 5</a>
</li>
</ul>
</div>
</div>
</div>
</div>
And CSS:
#headerDropdown .dropdown:hover .dropdown-menu,
.btn-group:hover .dropdown-menu {
display: inline-flex !important;
}
You can use CSS transition
with delay
. But you can't use it with display
property, So do it with visibility
instead.
.btn-group .dropdown-menu {
display: inline-flex;
transition: all 0s ease 1s; /*delay 1s*/
visibility: hidden;
}
.btn-group:hover .dropdown-menu {
transition-delay: 0s;
visibility: visible;
}
Updated jsFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With