Accurately detect mouseover event for a div with rounded corners

前端 未结 5 610
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 08:42

I am trying to detect a mouseover event on a circle. I define the circle div like this:

.circle {
  width: 80px;
  height: 80px;
  -moz-border-radius: 40px;
  -         


        
5条回答
  •  余生分开走
    2021-02-06 09:19

    Here is an snnipet to calculate the distance betewwn two points (the center of the circle, and the mouseX/mouseY) using Javascript: http://snipplr.com/view/47207/

提交回复
热议问题