Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Draggable

.startDrag()

.startDrag( event:Object ) : void

This is rarely used, but you may force the Draggable to begin dragging by calling startDrag() and passing it the original mouse/touch/pointer event that initiated things - this is necessary because Draggable must inspect that event for various information like pageX, pageY, target, etc.

Parameters

event: Object

mouse or touch event

Details

This is rarely used, but you may force the Draggable to begin dragging by calling startDrag() and passing it the original mouse/touch/pointer event that initiated things - this is necessary because Draggable must inspect that event for various information like pageX, pageY, target, etc. You cannot callstartDrag() without passing that original event.

startDrag() is different than enable() in that enable() activates the Draggable instance so that it responds to user interaction whereasstartDrag() actually begins dragging the element, as if the user clicked on it and started dragging. 

A great place to learn more about working with mouse/touch/pointer events is https://developers.google.com/web/fundamentals/design-and-ux/input/touch/.

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