When the window is resized, the floating divs will be wrapped to the next line, as expected. But I would really like this layout change to be animated.
EDIT:. As an aside, it would be nice to find a solution for this that is independent of jQuery. I don't mind writing my own js if I need to. Ideally, I would like to implement this in the AngularJS directive as soon as I see that it works, therefore, therefore I do not want the jQuery dependency.
Here is a shortened version of my code: http://jsfiddle.net/cDS7Q/3/
HTML
<div id="content"> <div> </div> <div> </div> <div> </div> <div> </div> <div> </div> </div>
And here is my CSS
body {background-color: #333;} #content div { position: relative; float: left; background-color: #eee; margin-left: 10px; margin-bottom: 10px; width: 100px; height: 100px; -webkit-transition: all .2s ease; -moz-transition: all .2s ease; -ms-transition: all .2s ease; -o-transition: all .2s ease; transition: all .2s ease; } #content { margin-top: 50px; padding-top: $gutter; padding-bottom: 50px; overflow: hidden; width: 100%; }
The effect I'm trying to achieve is similar to this site: http://saffron-consultants.com/journal/
Resize the window to see how the blocks enliven their new positions.
source share