이미지를로드 한 후 div 높이와 일치하는 데 문제가 있습니다. 그것은 가장 큰 div의 높이를 얻지 만, 이미지가로드되기 전에 그것을 얻는 것처럼 보입니다. 이 주변에 어떤 방법이 있습니까? 여기 페이지로드 후 div 높이가 일치 jQuery
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/
행운이 없습니다. 여전히 똑같은 일을합니다. – Lukasz
약간의 손놀림과 함께, 나는 이것을 작동하게했다, 고마워! function matchColHeights (col1, col2) { $ ('img'). function() { var col1Height = $ (col1) .height(); 경고 ('col1 :'+ col1Height) \t VAR col2Height = $ (COL2) .height의(); \t 경고 ('COL2'+ col2Height) \t \t (col1Height
Lukasz