У меня проблемы с перетаскиванием, позиционированием в jquery.
Вот то, чего я пытаюсь достичь:
- Вы перетаскиваете клон div в другой div, который является "стадией"
- Мне нужно расположитьклона, а не оригинала
Вот моя попытка до сих пор:
$(function() {
$("#workspacemaster").droppable({
accept: '.draggable',
drop: function(event, ui)
{
}
});
// Make images draggable.
$("#draggable1").draggable({
// Find original position of dragged image.
start: function(event, ui) {
// Show start dragged position of image.
var Startpos = $(this).position();
$("div#start1").text("1 START: \nLeft: "+ Startpos.left + "\nTop: " + Startpos.top);
},
cursor: 'move',
grid: [20, 20],
// Find position where image is dropped.
stop: function(event, ui) {
// Show dropped position.
var Stoppos = $(this).position();
$("div#stop1").text("1 STOP: \nLeft: "+ Stoppos.left + "\nTop: " + Stoppos.top);
}
});
});