Jump to content

jQuery mousing over an element without mouseover event listener

myselfolli
Go to solution Solved by myselfolli,

Nvm, I just found this (CSS, attatched to the element I am moving):

#movingElement {
  pointer-events: none;
}

 

Okay, so I have a very specific problem, maybe one of you guys can help me out:

 

I'm currently building my own Drag & Drop API, mostly because I dislike the APIs that are publicly available for one reason or another (and because I want to learn). But I've hit a dead end.

I've gotten my element to move with the mouse when I click it, so far so good. But now I want to be able to detect when I move the element (so my mouse) over a designated 'drop zone':

 

image.png.febee0ee8a8159acbde073691164df61.png

But I can't use jQuery's 'mouseover' event listener, since I am actually not moving my mouse over the drop zone, but over the element which I am moving, which is over the drop zone. I guess you could say the elemen I am moving is 'shielding' the drop zone and preventing the event listener from ever firing.

 

Do you guys have any idea?

 

P.s.: yes I know my explanation sucks.

 

Edit: Essentially the drop zone has a lower z-index than the element I am moving

Edited by myselfolli
Better explanation... kinda

75% of what I say is sarcastic

 

So is the rest probably

Link to comment
Share on other sites

Link to post
Share on other sites

Nvm, I just found this (CSS, attatched to the element I am moving):

#movingElement {
  pointer-events: none;
}

 

75% of what I say is sarcastic

 

So is the rest probably

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×