Jump to content
GreenSock

Draggable

.endX

.endX : Number

[read-only] The ending x (horizontal) position of the Draggable instance which is calculated as soon as the mouse/touch is released after a drag, meaning you can use it to predict precisely where it'll land after a throwProps flick.

Details

The ending x (horizontal) position of the Draggable instance. endX gets populated immediately when the mouse (or touch) is released after dragging, even before tweening has completed. This makes it easy to predict exactly where the element will land (useful for throwProps:true Draggables where momentum gets applied). For a Draggable of type:"x,y"endX would pertain to the x transform translation, as in the css transform:translateX(...). For type:"top,left", the Draggable's x would refer to the css "left" value that's applied. This is not the global coordinate - it is the inline css-related value applied to the element.

Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
×