问题
I'm working with something like this: http://jsfiddle.net/Hh2Ht/
As you can see, I have a group of float divs with the same width but with different heights. However, the container have a percentual width and as a consecuence, when changes its size the floating divs changes its position.
I would like that this change of position was animated, using css transitions. I could do that with absolute positioning, a little bit of javascript to calc the positioning and binding the transition effect to top and left propierties, but as I want to emulate exactly the behavior of float divs it would be excellent do it without absolute positioning.
Do you think that it is possible? Thank you in advance.
回答1:
I am really not sure it's possible to relocate blocks as you described with pure CSS. Mainly that's because some of the blocks would have to be moved into different position in DOM which is not possible with CSS.
Have you tried using Isotope plugin? Check their website, maybe that's what you're looking for.
来源:https://stackoverflow.com/questions/10580281/css-transition-on-float-relocation