jQuery: hover (mouseleave event fired when mouse is over child)
Posted
by
CronosS
on Stack Overflow
See other posts from Stack Overflow
or by CronosS
Published on 2011-01-16T14:22:02Z
Indexed on
2011/01/16
14:53 UTC
Read the original article
Hit count: 274
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.
© Stack Overflow or respective owner