Possible Duplicate:
How to detect if two divs touch with jquery?
I've spent a lot of time trying to figure out how to detect if two divs are overlapping.
I tried the gamequery plugin and used it like this:
$("#" + checkform).collision("#" + checkform + "w").each(function(){
alert("Collision");
});
Would you use the gamequery plugin and/or how would you do it?
Use getBoundingClientRect()
on each element, and see if they overlap that way. No jQuery needed.