How to disable mouseout events triggered by child elements?

后端 未结 9 1182
野的像风
野的像风 2020-11-30 21:09

Let me describe the problem in details:

I want to show an absolute positioned div when hovering over an element. That\'s really simple with jQuery and works just fin

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 21:34

    The way I've usually seen this handled is to have a delay of about 1/2 second between moving the mouse from the HoverMe element. When moving the mouse into the hovered element, you would want to set some variable which signals that you are hovering over element, and then basically stop the hovered part from hiding if this variable is set. You then have to add a similar hide function OnMouseOut from the hovered element to make it disappear when you remove the mouse. Sorry I can't give you any code, or something more concrete, but I hope this points you in the right direction.

提交回复
热议问题