嗨,我需要实现这个..
我有一套可放置的物品(基本上我是在服装上放下设计)而且我正在丢弃一个克隆物..
如果我不喜欢被丢弃的对象(设计) - 我想通过做一些像隐藏的东西来删除它.
但我无法做到这一点.
请帮我..
var clone;
$(document).ready(function(){
$(".items").draggable({helper: 'clone',cursor: 'hand'});
$(".droparea").droppable({
accept: ".items",
hoverClass: 'dropareahover',
tolerance: 'pointer',
drop: function(ev, ui)
{
var dropElemId = ui.draggable.attr("id");
var dropElem = ui.draggable.html();
clone = $(dropElem).clone(); // clone it and hold onto the jquery object
clone.id="newId";
clone.css("position", "absolute");
clone.css("top", ui.absolutePosition.top);
clone.css("left", ui.absolutePosition.left);
clone.draggable({ containment: 'parent' ,cursor: 'crosshair'});
$(this).append(clone);
alert("done dragging ");
/lets assume I have a delete button when I click that clone should dissapear so that I can drop …Run Code Online (Sandbox Code Playgroud)