开发者

OnMouseOver DIV trouble

开发者 https://www.devze.com 2023-04-06 19:40 出处:网络
Ok so my basic problem is as follows.I have an image that causes everything else on the page disable using a blank div with a z-index.This is during a mouseover event of the image.Next the code goes i

Ok so my basic problem is as follows. I have an image that causes everything else on the page disable using a blank div with a z-index. This is during a mouseover event of the image. Next the code goes into setting the z-index on the div that I want to be able to click or mouseover. Also I wrapping these images in a div that is used for a mouseout event to hide the images I do not want to show.

However when mousing over the images or text inside the div it causes the mouseout event to trigger. I have looked into event bubbling but it does not seem to be what is happening. Is there a way to turn off the mouseout event to object inside of the div with the mouseover event?

Long story short I ne开发者_运维百科ed to make a mouseout event not trigger on nested items.

Thanks in advance.


Instead of using mouseout you may go this way:

  1. when blocking the UI by overlaying the page with the blank div observe the mouseover-event of the wrapper-div
  2. When mouseover fires on the wrapper-div start observing the mouseover-event of the blank div
  3. When the mouseover fires on the blank div reset the page(remove the blank div)

The approach should be clear, if the mouse is over the blank div it must be outside the wrapper-div.

0

精彩评论

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

关注公众号