Course lesson

Animate and Center an Element to a Click Event with GreenSock

Animating an element to a click event is as simple as passing the x and y coordinates of the click event to the properties of the TweenMax.to call. To be able to center the element where the mouse clicks, you also need to adjust the special xPercent and...

Duration
3 min
Access
Pro
Transcript
Available

Animating an element to a click event is as simple as passing the x and y coordinates of the click event to the properties of the TweenMax.to call. To be able to center the element where the mouse clicks, you also need to adjust the special xPercent and yPercent properties so the element is properly offset.