Why doesn't FireFox always pick the correct target? (Path element)

I'm not sure if this is a bug in firefox and what is not, but I have a problem that only exists in firefox.

I have the html code below:

<div id="Div1"></div>   
<div id="mydiv">
   <div style="height: 590px;">
      <svg id="mySvg" style="height: 100%; width: 100%; z-index: 8000;">
         <g>
            <path stroke="black" d="M50,123L1400,323" style="stroke-width: 10; opacity: 1;">  </path>
         </g>
      </svg>
   </div>
</div>

      

Using javascript / jquery, I am trying to handle the mousemove event:

$("#mydiv").mousemove(function (x) {
  Div1.innerHTML = x.target.tagName;
});

      

The problem is that even when the mouse is over the line, it doesn't always show the path as the target name of the eventName tag.

Note:

  • It doesn't seem to be a problem when the path angle is (0 degrees)
  • It doesn't seem like a problem when the line is short
  • As mentioned, this is not an issue in IE9, nor in Chrome v24. I am testing FireFox v18.

I created a jsFiddle to view.

If at all possible, please let me know if I am doing something wrong or if there is a workaround for this problem.

Thank you for your help

+3


source to share


1 answer


I believe this has been posted before and it is related to a bug in firefox.



https://bugzilla.mozilla.org/show_bug.cgi?id=676001

+1


source







All Articles