Chris Bornhoft
Chris Bornhoft

Reputation: 4291

jQuery UI get dragged/dropped offset

I'm trying to get the ui object's dropped offset value. As in the offset at the dropped position and not the element's initial position.

The following code hasn't worked for me:

$(ui.helper).offset().left;
$(ui.helper).draggable().offset().left;
$(ui.helper).droppable().offset().left;

Each of those returns the initial offset of the element. How do I get the dropped offset value?

Upvotes: 0

Views: 1425

Answers (1)

davin
davin

Reputation: 45545

Not familiar with the plugin, but assuming they're using basic jqueryui drag and drop, try

ui.offset

which is an object with properties top and left, relative to the page

Upvotes: 3

Related Questions