【发布时间】:2011-12-14 05:24:55
【问题描述】:
如果 DIV 有任何 margin-top/margin-bottom,我将如何添加到下面的代码中?我目前的情况是我有 2 列(DIV),1 列有边距顶部,而另一列没有,这导致列无法正确排列。
抱歉,代码已被缩小,我丢失了原始代码。
$.fn.equalHeight = function (a) {
var b = {
delay: 100,
minusHeight: 0
};
var a = $.extend(b, a);
var c = 0;
var d = 0;
var e = $(this);
setTimeout(function () {
e.each(function () {
c = $(this).outerHeight();
d = c > d ? c : d
});
return e.each(function () {
var b = $(this);
var c = d - (b.outerHeight() - b.height()) - a.minusHeight;
var e = jQuery.browser.msie && jQuery.browser.version < 7 ? "height" : "min-height";
b.css(e, c + "px")
})
}, a.delay)
};
【问题讨论】:
标签: jquery jquery-plugins