Skip to content

Instantly share code, notes, and snippets.

@vancouverwill
Created September 10, 2013 18:58
Show Gist options
  • Save vancouverwill/6513983 to your computer and use it in GitHub Desktop.
Save vancouverwill/6513983 to your computer and use it in GitHub Desktop.
resizable content area to fit to screen size when scrolling down page or page being resized
function setContainerHeightToPage(container, heightFromTop)
{
var gridHeight = jQuery(window).height() + jQuery(document).scrollTop() - heightFromTop;
$(container).css('height', gridHeight + 'px');
}
function intializeSetContainerHeightToPage( container, heightFromTop)
{
setContainerHeightToPage( container, heightFromTop);
$(window).resize(function(){
setContainerHeightToPage( container, heightFromTop);
});
$(window).scroll(function(){
setContainerHeightToPage( container, heightFromTop);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment