Good day. I try to draw a menu, when I hover over a div
another div
(submenu) falls out.
$(document).ready(function() { $('.nav__cli').hover(function() { $('.nav__sub_cli').show(); }); $('.nav__cli').mouseleave(function() { $('.nav__sub_cli').hide(); }); });
By itself, when the cursor leaves the menu item, the submenu disappears. The menu is horizontal, that is, if we move the cursor to the next item or up, the submenu should disappear, and if we switch to it, it is natural to stay and disappear if the cursor goes to the side from the submenu block. How can this be realized?
nav__sub_cli
intonav__cli
- Artem Gorlachev