Hi there,
Just starting out with Draggable and am having some fun. However, I'm trying to do something that I'm unable to figure out and am hoping someone can help me out.
I am trying to delete/remove/kill a draggable item when it is dragged out of bounds. I'm not sure which event to use, nor how to delete/remove/kill active draggable item.
I am using this CodePen as the basis for my experimentation:
See the Pen Jlfsq by rher
Hi and welcome to the GreenSock forums,
There isn't an onOutOfBounds event or anything similar in the API that will detect when an element goes out of bounds for you but there are enough hooks to whip something up. You would just have to run your own logic onDrag to see if the element has gone beyond the bounds.
Fortunately there are values like minX, maxX, minY and maxY that make it relatively straightforward to know what the bounds values are.
I got the solution fr