How to implement a before start event to have a change to change the position and place in the DOM of the draggable element before jQueryUI start to drag?
For that I used mouseup and mousedown:
var timeout;
$('.draggable').mousedown(function() {
$('#dragContainer').append($(this));
$(this).css({
top: 0,
left: 0
});
});
$('.draggable').draggable();
I also used mouseup
to reset the old parent and position if the mousedown
was actually a click and not a drag.
It would be nice to have a beforeStart
event which work with the distance
option but I didn't find it...