链接到代码 - JS FIDDLE LINK
var makeDrag = function(){
$("#hello").draggable({
stop: function(){
alert("Done dragging");
$("#hello").draggable("destroy");
var copy = $("#hello").clone(true);
$("body").append(copy);
copy.html("DRAG");
copy.draggable();
copy.css("left","120px");
copy.css("top","140px");
makeDrag();
}
});
}
makeDrag();
<div id="hello">DRAG</div>//THIS DIV SHOULD BE FIXED IN THE SAME POSITION
我可以拖放但是我的div你好要修复吗?怎么实现这个?例如EXAMPLE LINK
答案 0 :(得分:1)
使用helper: "clone"
选项。
$("#hello").draggable({
helper: "clone",
stop: function(){
//existing stuff
}
});