Opera, event.layerX / event.layerY properties and mouseDropped event

I am writing some application with Raphael.js. And it should handle mouse drag events.

That is, when mouse drag is ended, i try to catch the point on the Raphael’s Paper object (DIV / SVG element, actually) where the mouse caused drop event.

  • cancelling mouseout event when element is overlaid
  • Javascript: Is it possible to get hold of the mouse position outside of an event handler?
  • event.pageX/Y not working on touchmove
  • Attach an event in a child iframe to a handler in the parent window
  • React Events behavior
  • Using jQuery's .on function how do I get the originating element for the event?
  • FireFox and Chrome are doing well with event.layerX and event.layerY properties. But Opera does not have those.

    It has clientX / clientY, offsetX / offsetY and pageX / pageY properties (may be mistaken in the last two’ names) however. But i can’t create any algorithm to calculate the final mouse position.

    See, the mouse starts “dragging” pin of an circuit symbol (without actual dragging its image) and ends dropping on another one:

    enter image description here
    enter image description here

    So, Opera shows coordinates like (5, 7) when mouse causes drop event. I assume these are the coordinates around the second pin. But i do not need those – using them i can not find the pin user tries connect to.

    So, the questionis: do you know any way to find the mouse cursor coordinates when the drop event is called, relatively to the parent element it is dropping (e.g. Raphael’s Paper object and / or its container in the case described).

  • JavaScript or Jquery event handlers for “ctrl”/“shift” + mouse left button click
  • handle selected event in twitter bootstrap Typeahead?
  • How to bind events in Jquery for an element created after document load?
  • Custom “swipe” events in Mobile Safari not firing
  • Detect Mouse click location
  • Why does getPreventDefault() work but defaultPrevented doesn't?
  • One Solution collect form web for “Opera, event.layerX / event.layerY properties and mouseDropped event”

    Can you keep updating variables with the location of the cursor during mouse move when the mouse button is down and use the last values set when the drop is fired?