我已经定位了 2 个容器,使得一个容器覆盖在另一个容器上。但是,当我将一个物品放到容器上时,掉落的物品会进入两个容器。我该如何限制它?
//JS Code:
$("div.draggable").draggable({
helper: "clone",
cursor: "move",
containment: 'body'
});
$("div.droppable").droppable({
addClasses: false,
drop: function (event, ui) {
var $draggable = $(ui.draggable),
$droppable = $(this);
$droppable.html($draggable.clone());
}
});
演示:http: //jsfiddle.net/HL8VR/