Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    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 yPercent properties so the element is properly offset.