0

I am trying to build a small app. one column has 5 rectangles. (vertically aligned) I want to drag&drop the rectangle into another area, while keeping the same rectangle in the column, so I could drag&drop it again.

Is this possible?

Thank you

motti10
  • 63
  • 1
  • 2
  • 11
  • Yes it is possible, you will just need to clone the rectangle. Something similar to this... http://jsfiddle.net/przbadu/rkvdffe3/18/ Got this from this http://stackoverflow.com/questions/25938520/jquery-drag-drop-and-clone-find-dropped-position-of-element – R4nc1d Mar 31 '15 at 21:34
  • I have my d&d working. I am trying to have a dblclick event on the dropped object, but keep getting a jquery error. Any suggestions? Thanks – motti10 Apr 01 '15 at 16:06
  • Yea depending on what jquery library you are using, you need to bind the newly created div to the Live() or On() event. i updated the fiddle http://jsfiddle.net/96e7xk3b/1/ – R4nc1d Apr 01 '15 at 16:24
  • Thanks I used the code you supplied in jFiddle. I can't seem to find the dropped object in order to do the dbl click event on it. – motti10 Apr 01 '15 at 16:56
  • Is it possible for you to send a code example of what you have so for? maybe create a fiddle – R4nc1d Apr 01 '15 at 18:55
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/74285/discussion-between-jacques-and-motti10). – R4nc1d Apr 01 '15 at 19:01

1 Answers1

1

Is this what you are looking for?

Check the link http://jsfiddle.net/tt99ugsf/

$('.square1').draggable({
    revert:"valid",
    helper:"clone"
});

The trick is to clone the div

R4nc1d
  • 2,923
  • 3
  • 24
  • 44