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
    http://jsfiddle.net/raltman/KDRtT/1/
  2. Petyo
    Admin
    Petyo avatar
    2438 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

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top