Drag element from inside one div into another

后端 未结 2 600
遥遥无期
遥遥无期 2021-01-27 02:36

I want to have the capability of dragging an element from inside one div into another.

jQuery UI draggable and droppable, but they seem to only manipulate the elements v

2条回答
  •  伪装坚强ぢ
    2021-01-27 02:57

    It is not manipulating DOM because as far as I know that's what they are designed to do.

    If you want to manipulate the DOM then you can the following trick

    You can use helper option, THEN when the element is dropped, read the co-ordinates and then use jQuery Clone function to clone your original div#moveMe to the drop area #secondDiv AND THEN remove the original element #firstDiv > div#moveMe

提交回复
热议问题