Gradually change the transform-origin from "50% 50% 0" to "0 0 0", and back:

Note: The grey DIV element indicates where the DIV2 element would be without the transformation.

DIV1
DIV2
DIV2

The transform-origin property is animatable in CSS.

Note: CSS Animations do not work in Internet Explorer 9 and earlier versions.