I have two container left side , right side , I drag element from left and puts in right side, the left side container has two types one is cloned after drag and another removed , so I have placed two drag drop , first one is dropping twice .
(我有两个容器左侧,右侧,我从左侧拖动元素并放到右侧,左侧容器有两种类型,一种是拖动后克隆,另一种是移除,所以我放置了两个拖放,第一个拖放两次。)
Cloned after dragged:
(拖动后克隆:)
<ul class='list-inline edit_audit_container edit_draggable elementUl>
<li class='item'>
<input type='text' readonly>
</li>
</ul>
This one removed after dragged:
(拖动后将其删除:)
<ul class='list-inline audit_container draggable elementUl>
<li class='item'>
<input type='text' readonly>
</li>
</ul>
Dragged in this container
(拖到这个容器里)
<div class="wid30c1 border droppable draggablemain">
</div>
image link : https://prnt.sc/q3skww
(图片链接: https : //prnt.sc/q3skww)
$(function () { $('.draggable').draggable({ revert: "invalid", stack: "0", helper: 'clone' }); // above codes drops twice $('.edit_draggable').draggable({ revert: "true", stack: "0" }); $('.droppable').droppable({ accept: ".draggable,.edit_draggable", drop: function (event, ui) { $(this).find("input").remove(); var droppable = $(this); var draggable = ui.draggable; draggable.clone().appendTo(droppable); $(this).find("input").attr("name", "headercols[]"); } }); });
ask by Arnav Pundir translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…