CSS Section
<style type= "Text/css" >
#wrap {
width:980px;
margin:0 Auto;
BORDER:1PX solid blue;
}
#wrap ul{
width:250px;
margin:10px;
border:1px solid #ccc;
Float:left;
padding:0;
}
#wrap ul li{
width:248px;
List-style:none;
margin:0;
padding:0;
margin-top:10px;
BORDER:1PX solid yellow;
}
</style>
HTML section
<div id= "Wrap" >
<ul></ul>
<ul></ul>
<ul></ul>
</div>
Js-dom part
<script>
function Fnrand (Min,max) {
Return parseint (Math.random () * (max-min) +min);
}
Window.onload=function () {
var Owrap=document.getelementbyid ("Wrap");
var Aul=owrap.children;
for (Var i=0;i<10;i++) {
var oli=document.createelement ("Li");
Oli.style.height=fnrand (100,300) + "px";
var ul1=aul[0].offsetheight;
var ul2=aul[1].offsetheight;
var ul3=aul[2].offsetheight;
var min=ul1;
if (UL1<UL2) {
if (UL1<UL3) {
MIN=UL1;
}
else{
MIN=UL3;
}
}else{
if (UL2<UL3) {
MIN=UL2;
}
else{
MIN=UL3;
}
}
for (Var j=0;j<aul.length;j++) {
if (min==aul[j].offsetheight) {
MIN=AUL[J];
}
}
Alert (' a ');
Min.appendchild (OLi);
}
}
</script>