Jump to content
GreenSock

Draggable

.lockAxis

.lockAxis : Boolean

If true, dragging more than 2 pixels in either direction (horizontally or vertically) will lock movement into that axis so that the element can only be dragged that direction (horizontally or vertically, whichever had the most initial movement).

Details

If true, dragging more than 2 pixels in either direction (horizontally or vertically) will lock movement into that axis so that the element can only be dragged that direction (horizontally or vertically, whichever had the most initial movement). No diagonal movement will be allowed. Obviously this is only applicable for type:"x,y" and type:"top,left" and type:"scroll" Draggables. If you only want to allow vertical movement, you should usetype:"y" or type:"top" or type:"scrollTop" or if you only want to allow horizontal movement, you should use type:"x" or type:"left" ortype:"scrollLeft".

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.
×