我使用这个脚本来平衡元素的高度:
(function ($) {
$.fn.autoheight = function () {
var height = 0,
reset = $.browser.msie ? "1%" : "auto";
return this.css("height", reset).each(function () {
height = Math.max(height, this.offsetHeight);
}).css("height", height).each(function () {
var h = this.offsetHeight;
if (h > height) {
$(this).css("height", height - (h - height));
};
});
};
})(jQuery);
我想为其添加一个额外的功能 - 将类“最长”添加到均衡高度时发现的最长元素,我在上面的脚本中要改变什么?
非常感谢。