Jquery on hover (when there is an element above the element we're hovering)

匆匆过客 提交于 2019-12-24 05:38:37

问题


So there are two elements on top of eachother. How do i call a function as soon as the element (under the one on top) is hovered?

Thanks alot, I really need this to work :s


回答1:


You can use CSS pointer-events property:

In addition to indicating that the element is not the target of mouse events, the value none instructs the mouse event to go "through" the element and target whatever is "underneath" that element instead.

#top {
   pointer-events: none;
}

$('#underneath').hover(function(){
     ....  
})


来源:https://stackoverflow.com/questions/10556202/jquery-on-hover-when-there-is-an-element-above-the-element-were-hovering

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!