我能够在页面加载时将子容器与父母的高度相匹配,但是我的问题是在调整窗口大小时让它与父母的高度相匹配,这是我到目前为止的代码:
HTML:
<div id="ocg-hero" class="container">
<div class="row">
<div class="large-6 columns heroContent"> </div>
<div class="large-6 columns heroGraphic" > </div>
</div>
</div>
脚本:
function heroImageResize (){
var heroHeight = $("#ocg-hero .row").height(),
heroGraphicHeight = $(".heroGraphic").height();
$(".heroGraphic").css("height",heroHeight);
};
heroImageResize();
谢谢!