As a drop happens, I need to recover the original position of the draggable:
$('.article').droppable( {
drop: function(even, ui){
// ui.draggable.???
}
});
Since there is a "revert: "invalid" property on my draggable, I assume the original position is store somewhere. How can I find it?
Thanks,
You can use: ui.helper.position()
var startPos;
$( ".article" ).draggable({
revert: "invalid",
start: function(evt, ui){
startPos = ui.helper.position();
}
});
$(".parent").droppable({
drop: function(evt, ui){
// NOW RETRIEVE COORDINATES STORED BY THE DRAGGABLE :START
var x = startPos.left;
var y = startPos.top;
alert(x+' '+y);
}
});