[Solved] elegantly animate a stack of divs


fiddle

In order to make this work I did a couple of things:-

1 CSS

 .child {
 width: 40px;
 height: 40px;
 display: block; //inline block results in jerkiness when inserting items 
 margin:2px; //added margin to compensate for inline-block becoming block.
 border: 1px solid #AAAAAA;
 }

2 JS

setTimeout(function(){
    var newbox = "<div class="child  animated bounceInDown"></div>"
    $(newbox).prependTo('.container').hide().slideDown(500);//notice that I prepend to the container, then hide the 'newbox' and then slide it down -> this gives the desired effect.

}, 2000);

Hopefully that helps.

3

solved elegantly animate a stack of divs