I try to track the position of the mouse while I click and drag the value of a[href] to the bookmarks bar (this is for the bookmarklet). It seems to stop tracking after a few seconds after the start of the drag.
a[href]
The code is below.
var isDragging = false; $('a#dragthis') .mousedown(function() { $(window).mousemove(function(e) { isDragging = true; var x = e.pageX; var y = e.pageY; console.log(x + "|" + y); }); });
Here is a jsFiddle example: http://jsfiddle.net/GZpHP/
You need to return false in your mousedown handler to prevent the default action when selecting text when dragging.
return false
mousedown
Updated fiddle
I need the same thing, and in the end I used ondragstart and ondrop to register, and then processed the mouse position on the drop event.
ondragstart
ondrop
This is not perfect, but he does the job.