I am working on an HTML menu and I need to keep the markdown as is. The requirement is to have the content expand on hover over the "-link."
<div class="container">
<div class="first-div-in row-menu" data-menu-block="first-div-in">Title</div>
..some other buttons..
</div>
<div id="first-div-in" class="menu-in">
<div class="container" style="display:none;">
<div class="col-xs-10">
... here is content ...
</div>
</div>
</div>
The issue lies in the implementation. The concept is for the container with content to expand when the user hovers over the "div"-link. Once the cursor moves to this expanded container, it should remain visible.
Here is the JavaScript code:
var hover_menu = function() {
var parent = $(this);
var menu_block = $( parent ).data('menu-block');
$('#' + menu_block).slideToggle('slow');
}
$('.row-menu').on( 'hover', hover_menu );
I need my JavaScript code to expand the container on hover over the "div"-link, ensuring the container stays visible when the cursor moves to it. How can I achieve this behavior?