1var matchHeight = function(classe, perLine) {
2 var peeps = $(String(classe)+":visible").css('height','auto').get();
3 var line = isNaN(perLine) ? peeps.length : parseInt(perLine);
4 for(var i = 0;i<peeps.length;i=i+line) {
5 var height = 0;
6 for(var x = i;x<(i+line);x++) {
7 if(peeps[x] && peeps[x].clientHeight > height) height = peeps[x].clientHeight;
8 }
9 for(var x = i;x<(i+line);x++) {
10 if(peeps[x]) peeps[x].style.height = String(height)+"px";
11 }
12 }
13}
14// matchHeight(".sameHeight", itemsPerLine) for per row matchHeight
15// matchHeight(".sameHeight") to matchHeight across all elements