I wanted the black box to detect if it is going to collide on the bordered box.
If the black box detected a collision it will move around and go to the position clicked by the user.
How to do this with jquery?
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.
You can try jquery-collision. Full disclosure: I just wrote and released this. I also ran into this same issue, didn’t see a solution, so I wrote it myself.
It allows you to do:
and it will return the “#center”‘s that overlap with “#me”. (Or none.)