Created
September 10, 2013 18:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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