Recently just used a piece of JS from another user question and answer and it serves to be quite good in terms of being a solution to the initial issue I had which was to have footer stick to bottom of viewport height even on a page which content doesn't fill whole page, but it now seems to have caused another issue.
On pages that need scrolling to view all content, the page ends at viewport height and does not allow scrolling which means portions of content cannot be viewed.
The code which i have used is below, credit for the code goes to claudix and was from his answer on this page:
How to make the web page height to fit screen height
<!--Code Starts-->
<body style="overflow:hidden; margin:0">
<form id="form1" runat="server">
<div id="main" style="background-color:red">
<div id="content">
</div>
<div id="footer">
</div>
</div>
</form>
<script language="javascript">
function autoResizeDiv()
{
document.getElementById('main').style.height = window.innerHeight +'px';
}
window.onresize = autoResizeDiv;
autoResizeDiv();
</script>
</body>
<!--Code Ends-->
Was wondering if anybody knew something i could add to that piece of javascript that would have the above code work for a page that does not have full content, however, when scrolling is needed, the JS code is disabled ?
Thanks !