jQuery: hover (mouseleave event fired when mouse is over child)
- by CronosS
Hi,
I want to create a zoom effect on some thumbs.
Here is my javascript simplified code :
parent.hover(
function(){
parent.stop().animate({/* css */}, inputZoomDuration, "linear");
wrapper.stop().animate({/* css */}, inputZoomDuration, "linear");
child.stop().animate({/* css */}, inputZoomDuration, "linear");
},
function(){
alert("leave");
child.stop().animate({/* css */}, 140, "linear");
wrapper.stop().animate({/* css */}, 140, "linear");
parent.stop().animate({/* css */}, 140, "linear");
}
);
and the html is like :
<div parent>
<div wrapper>
<div child>
</div>
</div>
</div>
I increase the size of all my divs when I over the "parent". But a soon as I over (or leave, btw) one of the child, the alert appears.
Without the alert, the result is a very bugy animation.
Is there any way to prevent the mouseleave event to be fired when a child is overed?
Best regards,
thanks.