Determining relative positions

2 posts, 0 answers
  1. Robert
    Robert avatar
    39 posts
    Member since:
    Oct 2012

    Posted 07 Feb 2013 Link to this post

    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
  2. Petyo
    Petyo avatar
    2444 posts

    Posted 11 Feb 2013 Link to this post

    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

    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top