Jump to content
GreenSock

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

Does Draggable only work with DOM elements? Can I get it in a canvas-based app ?


GreenSock

Yes, Draggable is just for DOM elements. But the real magic behind all the fluid motion and snapping is InertiaPlugin, and that can be used to tween any property of any object, not just DOM elements. So yes, you can absolutely get this kind of motion in other contexts but you'd need to wire up the actual dragging logic yourself and then fire off an InertiaPlugin tween when the user releases their mouse/touch. InertiaPlugin can even track the velocity of any property for you too (even function-based getters/setters!), so it's quite a powerful tool.





×