I have a navbar
of Bootstrap with drop-down. I want to make hover
in the div class="dropdown-content"
dropdown also activate the hover
of the menu option a class="nav-link"
, since I have put styles to the option for hover
, but when I move to expand it stops be hover
on the option and remove the style.
The html fragment is as follows
<li class="nav-item dropdown">
<a class="nav-link" href="#"><i class="fa fa-database"><span class="tag"> BBDD<hr class="subrayado"></hr></span></i></a>
<div class="dropdown-content">
<a href="#"><i class="fa fa-folder-open"><span class="tag"> Clientes Totales</span></i></a>
<a href="#"><i class="fa fa-folder-open"><span class="tag"> Consulting</span></i></a>
<a href="#"><i class="fa fa-folder-open"><span class="tag"> Compliance</span></i></a>
<a href="#"><i class="fa fa-folder-open"><span class="tag"> Digital Transformation</span></i></a>
<a href="#"><i class="fa fa-folder-open"><span class="tag"> Tech Talent</span></i></a>
</div>
</li>
and what I'm trying with jQuery is this:
$(".dropdown-content").hover(function(){
$(this).parent().children().find("a").trigger("mouseenter");
}, function(){
$(this).parent().children().find("a").trigger("mouseleave");
});
Every time I do hover
on the drop-down or exit the drop-down I get an error by console that says:
Uncaught RangeError: Maximum call stack size exceeded
Let's see if you can help me. Thanks.