开发者

How do you do a JQuery slideDown when the 2 divs are overlapping?

开发者 https://www.devze.com 2023-01-29 16:31 出处:网络
Let\'s say there\'s a big div. onmouseover, a small div, which is on absolute, slidesDown(), in front of the big div.

Let's say there's a big div.

onmouseover, a small div, which is on absolute, slidesDown(), in front of the big div.

onmouseout, the small div hides().

Let's say I move my mouse to 开发者_JAVA技巧the small div after it dropped down. The problem is...when it gets there, there is a "twitch". That's because the browser sensed mouseout from the big div and a sudden mouseover. When I stop the mouse, the browser senses that I'm still on my big div (with the small div on top), and finally slidesDown the small div.

As I move my mouse around the small div, it twitches.


You can use jQuery .hover() method to attach event handlers. This problem occurs because of mouse event bubbling, IE has two special events called "mouseenter" and "mouseleave" which does not fire if you move your mouse in child elements, for more info on this you can checkout this link:

MouseEvents - QuirksMode

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消