This is a migrated thread and some comments may be shown as answers.

Determining relative positions

1 Answer 104 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 07 Feb 2013, 09:31 PM
I'm trying to create a drag/drop order-able list built on KendoUI and I am running into trouble determining the position of the draggable object in relation to other objects in the list

How would you determine the following:
  • The Draggable's position relative to its container?
  • The position of a DropTarget relative to the same container
The idea being that I can determine when an object move above (or below) another object and then swap their positions in the list.

Here is a jsfiddle containing the prototype
http://jsfiddle.net/raltman/KDRtT/1/

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 11 Feb 2013, 08:18 AM
Hi Robert,

You can use the jQuery offset method for that. I updated the fiddle to demonstrate how to get the position of the draggable hint

Regards,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Drag and Drop
Asked by
Robert
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or