<section>
<div class="section-wrap">
<h1>page1</h1>
</div>
</section>
<section>
<div class="section-wrap">
<h1>page2</h1>
</div>
</section>
My attempt at implementing javascript
only functions properly when the content of a div is less than the specified height.
<script type="text/javascript">
$(function(){
var windowH = $(window).height();
var wrapperH = $('section').height();
if(windowH > wrapperH) {
$('section').css({'height':($(window).height())+'px'});
}
$(window).resize(function(){
var windowH = $(window).height();
var wrapperH = $('section').height();
var differenceH = windowH - wrapperH;
var newH = wrapperH + differenceH;
var truecontentH = $('.section-wrap').height();
if(windowH > truecontentH) {
$('section').css('height', (newH)+'px');
}
})
});
</script>