I have a particular problem that I want to solve with CSS3 transitioning. So I have a container with inline-block elements, and once I select one of the elements, everything else will be hidden and that selected element should move smoothly to the top-left corner of the container.
For example, I have my container as below containing 8 elements wrapped in 2 lines:
= = = = =
A B C D
E F G H
= = = = =
And now I select G, everything else is hidden and G is moved to the top left corner:
= = = = =
G
= = = = =
My current approach is to set the width and height of all of G's siblings to 0, CSS3 transition works perfectly and I can see G move to the left edge smoothly. However, since G is in a 2nd line, it jumps up a line when everything on the first line shrinks. This movement is sudden and undesirable. I would like the effect to be like G moves smoothly diagonally to the top left corner.
I also looked at translate(x,y) but it is no good either, since I don't want to calculate how much pixels I have to move the box to the top left. It would be ideal if I can just make use of (position: absolute; left: 0; top: 0) somehow to automatically be at the top left, but as soon as I set the position to absolute the element would instantly jump.
Can any CSS3 master suggest a nice approach?