X
X
X
Website Search®
X
Blog Archive®

❖ Kolom Sama Tinggi dengan JQuery

JQuery Equal height

$(function() {
//set the starting bigestHeight variable
var biggestHeight = 0;
//check each of them
$('.kolom').each(function() {
//if the height of the current element is
//bigger then the current biggestHeight value
if($(this).height() > biggestHeight) {
//update the biggestHeight with the
//height of the current elements
biggestHeight = $(this).height();
}
});

//when checking for biggestHeight is done set that
//height to all the elements
$('.kolom').height(biggestHeight);
});

<div id='kolom-sama-tinggi'>
<div class='kolom'> ... </div>
<div class='kolom'> ... </div>
<div class='kolom'> ... </div>
<div class='kolom'> ... </div>
<div style='clear:both;'></div>
</div>



X

Posting Komentar