我是菜鸟,jQuery
我想了解当鼠标离开另一个元素时如何知道我的鼠标悬停在一个元素中。
我写了这段代码:
html
<ul>
<li class="conver">1</li>
<li class="conver">2</li>
<li class="conver">3</li>
<li class="conver">4</li>
<li class="conver">5</li>
</ul>
<div id="center">JSFIDDLE</div>
jQuery
$('ul').on('mouseenter','li', function () {
$('#center').fadeIn('fast');
}).on('mouseleave','li', function () {
//I want when mouse leave this element if mouse doesn't hover on ('#center')
//element so hide ('#center') element but if to be hover on it this div keep on
//and don't hide
$('#center').stop().fadeOut('fast');
});
现在告诉我,我如何知道鼠标离开li
元素何时在('#center')元素上!