I have a drag UI I'm creating, and I need to be able to disable anchor tags following an HREF if the user clicks on an anchor tag, but then drags more than 25 PX. The drag sensor I have working, the problem is I cannot use .click() because the mousedown has already fired for the drag, and .mouseup() seems to be too late to the game, because the event is still firing.
How do I make the following code right?
$(document).mousemove(function (e) {
distance = e.pageX - initialPosition;
$('#panorama').css({ 'left': distance });
if (Math.abs(distance - 0) > 25) {
//Event in question below:
$('a').mouseup(function (e) { e.preventDefault(); });
}
return false;
});