Jquery drag, drop and clone, find the dropped position of an element

Here is my fiddle for the jquery drag, drop and clone function.

Problem:

My problem: when I delete an item, it shows:

position: {top: 0, left: 0}

only for draggable, clone and droppable element.

I also wrote code to find a position using only a function draggable, and this works fine. I need this behavior indraggable, droppable with clone feature

Please visit JSFiddle

fiddle

full screen output

+4
source share
1 answer

Finally, I solved the problem. The problem was what I used ui.draggable.position();to store the dumped position in the database, which was wrong.

, :

// position of the draggable minus position of the droppable
// relative to the document
leftPosition  = ui.offset.left - $(this).offset().left;
topPosition   = ui.offset.top - $(this).offset().top;

: jQuery?

Jsfiddle

http://jsfiddle.net/przbadu/rkvdffe3/18/

http://jsfiddle.net/przbadu/rkvdffe3/18/embedded/result/

+5

All Articles