
Untitled
By: a guest on
Sep 21st, 2012 | syntax:
None | size: 0.56 KB | hits: 15 | expires: Never
var elem = $('div');
var count = elem.length;
var state = [];
var loop = function(){
setTimeout(function(){
elem.each(function(){
var that = this;
var $this = $(this);
var height = Math.random() > 0.9? Math.random()*30 : (state.filter(function(a){ return a[0] == that; })[0] || [0, 0])[1]*0.9;
state = state.filter(function(a){ return a[0] != that; }).concat([[that, height]]);
$this.css({
'background': '#fff',
'bottom': height + 1,
'height': height + 1
});
});
loop();
}, 30);
}
loop();