Answer the question
In order to leave comments, you need to log in
How to make an element show and hide when needed?
I need to hover over an item in one menu to bring up another menu below it. When hovering over this other menu, I want it to not disappear until I remove the cursor from this other menu. I do everything with jQuery.
Menu structure:
<!-- Основное меню -->
<nav class="main_menu">
<input type="checkbox" name="menu" id="btn-menu" />
<label for="btn-menu"><img src="https://img.icons8.com/ios/50/000000/menu--v1.png" width="30"></label>
<ul>
<li class=" zero_li">
<a href="https://sigma.irksite.ru/"><img src="/upload/landing/955/Bezymyannyy_1x_1x.png" class="logo" width="70" style="margin-bottom: 0px;"></a>
</li>
<li class="one_li">
<a href="https://sigma.irksite.ru/okompanii/" id="company">Компания</a>
</li>
<li class="two_li">
<a href="https://sigma.irksite.ru/proekty/" id="projects">Проекты</a>
</li>
<li class="three_li">
<a href="https://sigma.irksite.ru/pustayastranitsa/" id="investors">Инвесторам</a>
</li>
<li class="four_li">
<a href="https://sigma.irksite.ru/sotsialnayaotvetstvennost/" id="responsibility">Ответственность</a>
</li>
<li class="five_li">
<a href="https://sigma.irksite.ru/press-center/" id="press-center">Пресс-центр</a>
</li>
<li class="six_li">
<a href="https://sigma.irksite.ru/for-partners/" id="partners">Партнёрам</a>
</li>
<li class="seven_li">
<a href="https://sigma.irksite.ru/kontakty/" id="kontacts">Контакты</a>
</li>
</ul>
</nav>
<!-- 1-е подменю -->
<nav class="company">
<ul class="nav">
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/okompanii/#block347">История</a>
</li>
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/okompanii/#block363">Структура</a>
</li>
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/okompanii/#block371">Совет директоров</a>
</li>
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/okompanii/#block654">Менеджмент</a>
</li>
</ul>
</nav>
<!-- 2-е подменю -->
<nav class="projects">
<ul class="nav">
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/pustayastranitsa3/">Геология и запасы</a>
</li>
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/pustayastranitsa5/">Горные работы</a>
</li>
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/pustayastranitsa6/">Обогащение</a>
</li>
<li class="nav-item">
<a class="under_menu" href="https://sigma.irksite.ru/pustayastranitsa7/">Программа развития</a>
</li>
</ul>
</nav>
Answer the question
In order to leave comments, you need to log in
I found another way and settled on it - I check not when I remove the cursor from the menu, but when I hover it over a div. Everything works as it should.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question