I have this HTML:
<div id="content">
<div class='sub_menu a'></div>
<div class='sub_menu b'></div>
<div class='sub_menu c'></div>
<ul>
<li class='a'>link a</li>
<li class='b'>link b</li>
<li class='c'>link c</li>
</ul>
</div>
$('li').mouseleave(function(e) {
var cl = $(this).attr('class');
$(".sub_menu." + cl).show();
}).mouseleave(function() {
var cl = $(this).attr('class');
$(".sub_menu." + cl).hide(); //
});
On mouseenter on each <li>
the div sub_menu
with same class (a, b or c) will show up.
I need that when the mouseleaves the <li>
but is over the opened div, this div will remain open.
Now when I go with mouse over sub_menu, this will close up. I hope you understand what I'm trying to do!