0
How to detect when an element over another element in JavaScript.
How to detect if an element is over circle div element using JavaScript. From image ( https://i.ibb.co/5MZkrcg/My-drawing.jpg ) yellow circle is moving randomly. When it come on red circle, it's color will be change to blue.
4 Answers
+ 2
by doing computations to check if both elements intersect...
for circles that s quite simple: if distance beween two centers is less than sum of radius, then circles overlap ;P
0
Wow! It is very simple.
Thanks
0
yes: that's the most simple case... that's why we often use bounding circle (or sphere) to discreminate first more complex cases ^^