I want to animate left floated elements to their new position when the width property of the parent element is changed, to do this I am thinking of writing a loop to calculate the new position for every element but the browser does this already only that it does it jerky, is there a simpler way to avoid all the looping and calculation within TimelineMax ?
The pen I use as example almost does it but I'd like a smooth animation.
Cheers.
See the
You can use an animation technique I call relative animations to do this. It involves a loop, but you really don't have to calculate anything because the browser does the layout for you.
The relative position of your floated elements are at 0,0, even when the parent element resizes. However, the absolute position of your elements will change, which would be their offsetTop and offsetLeft values.
To start out, you need to save the absolute position of all your elements. When the parent r