I'm having a problem with a Menu.
It happens that when the person hovers the mouse in the Service link, a dropdown
happens, the menu appears, since it is with display:none
and when it passes the mouse it gets display:block
.
So far so good, but I'm having a problem, I need this to happen with more than <ul>
. But only 1%% of% is receiving this effect.
I want the person to move the mouse over the Call link, so this effect will happen in 2 or more <ul>
's there I can do it as if it were a <ul>
.
Code for Menu | Mega Menu
:
<li>
<a href="blog.html">Atendimento</a>
<ul><!-- Primeiro | No caso o .first() -->
<li><a href="base.html">Base de Conhecimento</a></li>
<li><a href="blog.html">Nosso Blog</a></li>
<li><a href="contato.php">Fale conosco</a></li>
<li><a href="suporte.html">Suporte</a></li>
</ul>
<ul><!-- Segundo | Não funciona -->
<li><a href="base.html">Base de Conhecimento</a></li>
<li><a href="blog.html">Nosso Blog</a></li>
<li><a href="contato.php">Fale conosco</a></li>
<li><a href="suporte.html">Suporte</a></li>
</ul>
</li>
Code for Menu | HTML
:
jQuery("#menu > li").hover(function() {
jQuery(this).find("ul").first().slideDown(600);
}, function() {
jQuery(this).find("ul").first().slideUp(200);
});
jQuery("#menu li ul li").hover(function() {
jQuery(this).find("ul").first().toggle(0);
});
jQuery("#menu li ul li").each(function() {
if(jQuery(this).has("ul").length > 0) {
jQuery(this).addClass("menu-arrow")
}
});
I think the problem is in jQuery
= first , in case it only works with the first .first()
, but I need it to work with 2 <ul>
.
Note: I tried to remove <ul>
, but it left the whole menu buggy. (I'm still a beginner)