I have an image inside a div. I want this image to be dragged into a div, and I want to keep the image coordinates. Using the "stop" event on Draggable works well for this and does exactly what I want. I also want the same code to be fired in the "create" event. However, when using the same code in the create event, it seems that the passed ui object is empty:
$(document).ready(function() {
$('#imageitem').draggable({
containment: "parent",
stop: function(event, ui) {
console.log(ui);
},
create: function(event, ui) {
console.log(ui);
},
});
});
The docs for UI / Draggable show that the create callback should receive a ui object:
$( ".selector" ).draggable({
create: function(event, ui) { ... }
});
ui.offset, - . , "ui" DOM , . ui.offset "" ?
, jQuery, - .