I have a grid of absolutely positioned divs (the grid consists of rectangles of various shapes that fit together to make a large rectangle).
I'm trying to animate the display of this grid by making all the individual rectangles “fly” into the grid from the screen. Thus, the rectangles on the left move on the left, on the right - on the right, etc.
I use CSS3 transitions, and when you fly from above or to the left, it works fine, I just use negative margins to place them off the screen and then animate it to change to margin-left (or margin-top) = 0 ( e.g. original / correct position).
This seems to make more sense than using transforms, but please correct me if you think there is a reason the transformation will work / work better for any reason?
However, this obviously will not work for margin-right / margin-top, and so I would like to know if anyone can suggest which best way to achieve this is from the right and bottom? I can do the overflow of the parent path: hidden and animate left / top positions that will have the same effect, but I would like to see if there is a general solution equivalent to negative fields to prevent the need to use separate rules / positions for each screen and on screen version? for example, when using negative margins, I can apply the same negative marker to all boxes that fly on one side, without any specific label of the element (but if I animate the top / left side, then each element will need its own "off-screen "the position relative to him is the final position so that it flies from the right place).
Alternatively, if there is a better way at all (CSS3 is great!), Then I would love to hear it!
html css margin css3 css-transitions
deshg
source share