Possible Duplicate:
jQuery/Javascript collision detection
What would be the best way using preferably using $.position to check if a <div> is being touched or overlapped by another <div>?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a function I wrote a while back that does this:
It takes as arguments two objects each containing width, height, left and top properties. Like this:
I guess you could move that offset stuff to the function if you don’t mind it being calculated every time you call it.