First: get the initial dimensions

Last: get dimensions after change

Invert: calculate deltas to move element to its original position

Play: animate from original position to final position