preventing mouseout event for child node

前端 未结 2 1083
谎友^
谎友^ 2020-12-11 08:33

I have list of images, on over on image i want to show some information on that image. And mouseout of the info div, same should disappear. Problem is when mouse moves on c

相关标签:
2条回答
  • 2020-12-11 08:55

    You can emulate behavior of mouseleave event:

    <div id="pop_div" onmouseout="if ((event.relatedTarget || event.toElement) == this.parentNode) clearinfo()" >
       <img alt="" src="" />
       <p>lines of text</p>
    </div>
    
    0 讨论(0)
  • 2020-12-11 09:01

    That is the behavior of mouseover. If you were using jQuery however, you could use mouseenter/mouseleave events.

    0 讨论(0)
提交回复
热议问题