Jump to content
Search Community

Is there a property defining a draggables center value?

AustinNotAustin test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

Hello again,


When dragging a div, I was expecting the x and y coord of the draggable obj to be the center of the div.

It doesn't seem to be the case. Is there a centerX property? I didn't see one in the docs.

If not, I can calculate it.

See the code pen example to understand why the center point is valuable to me. Red background color is representative of the closest element to my currently held draggable element. (Using the center point to determine which element is closer.



See the Pen XWgZqpG by AustinNotAustin (@AustinNotAustin) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...