📹 Video
- Use the random boxes from previous video but place the animation outside of the eventListener and set them to animate to a fixed point.
TweenMax.to(divs, 10 { x: 100, y: 100})
- Inside the click even function use 🤔TweenMax.killTweensof() and use event.target to select the box clicked on.
TweenMax.killTweensOf(event.target)
- Use 🤔TweenMax.killAll() instead to stop all animations.
TweenMax.killAll()
- Optionally you can pass an argument of true into killAll() to cause all animations to complete.
TweenMax.killAll(true)