第一:要理解Jq中的获取高度的三个方法height()、 innerHeight()、outerHeight()
height():height
innerHeight():height+padding
outerHeight():height+padding+border ;outerHeight(true) :height+padding+border+margin。
第二:一般用innerHeight()方法就可以了
$(function() {
var h_max = 0; $(".className").each(function(){ var h = $(this).innerHeight(); h_max = h_max < h ? h : h_max; }) $(".className").css('height',h_max);
})