Jquery draggable but leave a copy where the original element was

Say I have 3 emoticons, L, M and R at the top of the page. Below I have a destination field. Between them there is a statement: "Drag the average emoticon to the destination."

While draggable allows you to do this, it drags the actual item, not the copy. When the user drags the emoticon, I want the top 3 to remain motionless, and only a copy of what they moved to move. The user should be able to drag multiple copies, if necessary, into multiple target fields.

Basically, I'm looking for something like this

$("#drag-target-1").draggable('leave-copy'); 
+6
source share
1 answer

Use the helper property with a clone value to enable cloning of a drag and drop item.

  $("#drag-target-1").draggable({helper : 'clone' }); 
+9
source

Source: https://habr.com/ru/post/926633/


All Articles