jQuery: issues with mouseover event if the element has children
- by Patrick
hi,
I have the following element:
<div id="#block-block-1">
<p>KAREN LANCEL:<br>
lancel(at)xs4all.nl<br>
phone 0031 (0)624873424</p>
<p>HERMEN MAAT:<br>
maat(at)xs4all.nl<br>
phone 0031 (0)628536885</p>
</div>
which is supposed to disappear when the mouse is moved out of it (I will ignore now to talk about the fading in event).
This is the code to make it fading out:
$('#block-block-1').mouseout(function() {
$(this).css("display","none");
});
The issue here is that the 'mouseout' event is triggered when the mouse is over the children elements inside my div. And the parent disappears even if the mouse is still inside it.