Ilya Karnaukhov
Ilya Karnaukhov

Reputation: 3977

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

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

Upvotes: 2

Views: 1017

Answers (1)

Ram
Ram

Reputation: 144689

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(){
     ....  
})

Upvotes: 4

Related Questions