I have a dropdown menu that I have made to function much like a modal.
<div class="hidden-dropdown hide">
<ul>
<li><a>Blah</a></li>
<li><a>Blah balh</a></li>
<li><a>Blah</a></li>
</ul>
</div>
and some jQuery for when I hover over the div OR the nav bar link that has an id to be able to be selected the dropdown menu appears.
jQuery:
$(document).ready(function() {
if ( $("#kDropdown") || $(".hidden-dropdown").hover == true ) {
$("#kDropdown").hover(function() {
$(".hidden-dropdown").removeClass("hide");
});
} else {
$(".hidden-dropdown").addClass("hide");
}// end if
}); // document is ready
The code works fine to bring the dropdown menu into play by removing the "hide" class, but it doesn't work in removing it from sight.
What can I do to make the functionality work? All I need is the dropdown to appear when hovering over the navbar "#kDropdwon" and remove when it's not hovering over the navbar or the "hidden-dropdown" div.
Edit: added snippit of navar
<ul class="action-bar__menu--main action-bar__menu list--inline action-bar--show" id="SiteNav" role="navigation">
<li class="action-bar__menu-item hide-for-small-only {% if childlink.active %}action-bar--active{% endif %}">
<a href="{% if template == 'index' or template == 'page.index' %}#{% else %}https://domeha.com{% endif %}" class="action-bar__link">Home</a>
</li>
<li class="action-bar__menu-item hide-for-small-only {% if childlink.active %}action-bar--active{% endif %}">
<a href="{% if template == 'collection' %}#{% else %}/collections/all{% endif %}" id="kDropdown" class="action-bar__link">Products</a>
</li>
Thank you!
.hidden-dropdownnot#hidden-dropdown