clone node on drag

后端 未结 3 1758
天涯浪人
天涯浪人 2020-12-06 04:46

i want to be able to create a copy of the element that i want to drag. im using the standard ui draggable and droppable. i know about the helper clone option. but that does

3条回答
  •  青春惊慌失措
    2020-12-06 05:18

    Since I'm not able to comment (yet) I'll leave this as a separate answer - in case someone, like me, will find this question:

    For the question from comment

    "But I want the cloned/dropped element to be in the same position it was dropped. do you know how i can do it?"

    I've found solution in different SO question, and the answer is to change this line:

       $(this).append($(ui.draggable).clone());
    

    to

       $(this).append($(ui.helper).clone());
    

    (change ui.draggable to ui.helper)

    Hope it helps.

提交回复
热议问题