On http://pinterest.com/ there are \'pins\' ie
You can read the Pinterest cofounder's response to an earlier question about this: how to replicate pinterest.com's absolute div stacking layout
Easiest and Simple way i did, this looks armature. But i thought of sharing.....
This is three column layout...
First 3 container will not add height to it.. 4th container will take the height and top position of 1st container(that is prev().prev().prev()
)
counter = counter+1;
if(counter > 3){
var getTop = $(this).prev().prev().prev().offset();
var getLeft = $(this).prev().prev().prev().offset();
var getHeight = $(this).prev().prev().prev().height();
var countTPH = getTop.top + getHeight - 20;
$(this).css({"position":"absolute","top":countTPH+"px","left":getLeft.left+"px"});
}
I have put prev()
just to make reader understand the code simple1