<script type="text/javascript">
function resizeLI(){
var h = $(".product_con").width();
var $lis = $(".product_con li");
var str = 0;
$lis.each(function(i,dom){
var len = $(this).html().replace(/<(///s*)?((/w+:)?/w+)(/w+(/s*=/s*((["'])(//["'tbnr]|[^/7])*?/7|/w+)|.{0})|/s)*?(///s*)?>/ig,"").length;
var temp = str + (len+1)*12;
//alert("h:"+h+"/nstr:"+str+"/ntemp:"+temp+"/nnum:"+i);
if(temp < h)
str += (len+1)*12;
else{
$(this).before("<li style='display:block;float:none;clear:both;font-size:0'></li>");
str=0;
}
});
}
$(function(){
resizeLI();
})
</script>
div宽度为百分比,checkbox和文字一起到下一行!
.product_con:div名字