I'm playing with the HTML5 drag and drop and tracking the mouse position while dragging.
OffsetX and OffsetY works awesome until you release the mouse, the offsets jump to a negative number on the last drag event dispatched
here's the html:
<div id="dragger"></div>
<div id="console"></div>
here's the css:
#dragger{
-webkit-user-drag: element;
width: 100px;
height: 100px;
background: hsla(200, 100%, 50%, 0.4);
}
and the js
$('#dragger').bind('drag', function (e) {
$('#console').html(e.originalEvent.offsetX);
})
You can also test out at http://jsfiddle.net/Eu2mz/5/
Also I'm just trying to get it to work in webkit for now.
e.originalEvent.y === 0
– Timmerz Sep 15 '14 at 20:06