Javascript design tutorial fix for 100% document height

Not open for further replies.


Yellow Belt
I think it might happened to you as well that you put your content together and the footer element was not at the bottom of the page but was at higher verical position since the main content holder div had smaller height value. I hope you still could follow me so far.
I have compiled the following script in order to stretch the height of the main content holder div element to provide 100% documentum height.

var totalheight = document.body.offsetHeight;
var B=navigator.appVersion;
var should=window.innerHeight;}
var should=document.documentElement.clientHeight;
var other=229;
var optimal=should-other +'px';
if (totalheight<=should){
There are only two things need to get customized:
i. The value of the other variable (var other) - Write here the summation height of every document element which affect the vertical stretching.
ii. The ID of the contentholder element. All you need to do is to replace the contentholder with the suiteable one.
Not open for further replies.