俩div左右两侧自适应高度对齐

function $(mo_l){
return document.getElementById(mo_l)
}
function getHeight() {
if ($(“mo_l”).offsetHeight>=$(“mo_r”).offsetHeight){
$(“mo_r”).style.height=$(“mo_l”).offsetHeight + “px”;
}
else{
$(“mo_l”).style.height=$(“mo_r”).offsetHeight + “px”;
}
}
window.onload = function() {
getHeight();
}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注