I've set up a mousemove
handler to drag an element. However, if you move the cursor too quickly, it loses track of the element and doesn't move it anymore until you bring your cursor back over the element.
Here's a JSFiddle demo.
Why does it do that?
$this.on("mousemove.partmove touchmove", function(e){
e.preventDefault();
var moveL = e.clientX;
var moveT = e.clientY;
console.log("mov " + (moveT-vOffset) );
$this.css({"left": moveL-hOffset, "top": moveT-vOffset});
});
mousemove
handler to a larger parent element, such asbody
. – Fiver