Draggable

.x

.x : Number

[read-only] The current x (horizontal) position of the Draggable instance.

Details

The current x (horizontal) position of the Draggable instance. For a Draggable of type:"x,y", it would be the x transform translation, as in the csstransform: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. This value is updated each time the Draggable is dragged interactively and during the momentum-based tween that Draggable applies when the user releases their mouse/touch, but if you manually change (or tween) the element's position you can force Draggable to look at the "real" value and record it to its own "x" property by calling the Draggable's update() method. Basically that re-synchronizes it. Again, this is not necessary unless other code (outside Draggable) alters the target element's position.
Implementation
    public function get x():Number

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.

Get GSAP

Version: 2.0.2 updated 2018-08-27

Core

    Extras

      Plugins

        By using GreenSock code, you agree to the terms of use.

        Help support GreenSock by becoming a member

        Join Club GreenSock