I mean, I’d like to check (on a .hover function) if my cursor pointer is into/outo a zone.
This is an example :
HTML
<ul class="menuLeft">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
jQuery
$('.menuLeft > li').hover(
function() {
alert("i'm into UL");
},
function() {
//if the cursor, when I leave a li, is into the ul, print "IN", else "OUT"
}
);
I can’t say I fully understand the question. It looks like you want “in” to be triggered when an LI is entered and “out” to be triggered when you leave the UL altogether. But since “in” can just as easily be triggered by entering the UL instead of an LI, why not do this?
http://jsfiddle.net/429zG/
(
hoveredclass just hasbackground-color: green)Trying to track success of your code with alerts is going to be tricky for mouse events, which is why I just add or remove a class instead.
If you want to track BOTH the LI hover and a UL hover, you just need to bind two different event handlers.
http://jsfiddle.net/429zG/1/
(code not pasted; all it does is bind another event with an LI selector that changes each LI’s background color on hover)