【发布时间】:2012-01-26 04:31:04
【问题描述】:
加载图像后,我无法匹配 div 的高度。它获得了最高 div 的高度,但它似乎是在加载图像之前获得的。有没有办法解决?这是我目前所拥有的:
function matchColHeights(col1, col2) {
var col1Height = $(col1).height();
alert('col1 '+col1Height);
var col2Height = $(col2).height();
alert('col2 '+col2Height);
if (col1Height < col2Height) {
$(col1).height(col2Height);
} else {
$(col2).height(col1Height);
}
}
$(document).ready(function() {
matchColHeights('#leftPanel', '#rightPanel');
});
这里是运行它的链接:http://www.tigerstudiodesign.com/blog/
【问题讨论】: