Check if one div is hovering another - jQuery/Javascript [duplicate]
Basicly I want to check if one div is hovering another div, I've searched a lot for this, but couldn't find anything D:
I made a div that you can control by using the arrow keys, so now I want to check if that div is hovering another div, if so it should do som开发者_高级运维ething.
I really can't figure this out, please help.
You may take a look at hitTestObject
It seems that you want to detect collision between two elements. So, on some event (keyDown maybe in your case) you have to detect if any of corners of first element (top-left, top-right, bottom-left, bottom-right) is within second element area (somewhere between his corners).
精彩评论