Freewall is a cross-browser and responsive jQuery plugin to help you create many types of grid layouts: flexible layouts, images layouts, nested grid layouts, metro style layouts, pinterest like layouts ... with nice CSS3 animation effects and call back events. Freewall is all-in-one solution for creating dynamic grid layouts for desktop, mobile and tablet.
Based on the width (or height) of a container and the width (height) of a cell unit, It will create a virtual matrix. Scaning the matrix at each cell will find a free cell around to made a free area, then try to fit a block element into it. In case no block can fit the gap, it will resize the block to fill the gap (that is one of the options).
var wall = new freewall('.free-wall');
wall.reset({
selector: '.brick',
onResize: function() {
this.fitWidth();
}
});
var wall = new freewall('.free-wall');
var dna = $(".free-wall .flex-layout");
wall.unsetFilter();
wall.fixSize({
block: dna,
width: 150,
height: 150
});
wall.fitWidth();
var ewall = new freewall(demo);
var demo = $(".example");
ewall.reset({
selector: '.cell',
animate: true,
delay: 20,
cellW: 15.5,
cellH: 15,
gutterX: 2,
gutterY: 2
});
ewall.fitWidth(cwidth);