I'm implementing a visual editor where users are allowed to drag images onto the page, and drag other images inside these previously dragged images (kind of 'add another image').
I basically only need the mouse coordinates during the drag: the element hiliting etc... I do with custom functions based on these coordinates.
The problem is, while on Webkit I can get them with event.clientX
and event.clientY
, under Firefox (v.16.0.1 OSX) their 'counterparts' pageX
and pageY
are always zero in my experience during a drag.
However, they are not zero during mouseMove
.
Smart as I am, I did a
$(document).on("mouseMove",function(e){__PX=e.pageX,__PY=e.pageY});
to always have the latest pageX
and pageY
so I could use them inside the onDrag
handler but...
the OnMouseMove
does not fire during a Drag And Drop operation :( :(
Is there any way I can get the Mouse X and Y during a DnD? I'd like not to clutter my code too much, as it already works on different platforms but not on Firefox.