Link to home
Start Free TrialLog in
Avatar of RTKHOT
RTKHOTFlag for India

asked on

changing web page row height dynamically

My web page has 3 sections, header area (height 50px), central body area (height 300px) and footer area (height 50px). it will always remain the same.

I have inserted a div between the central body and the footer, and its height is zero by default.

I want to dynamically set its height when the page loads, so that the TOTAL height of all the elements above always fills the browser screen height for all standard screen sizes.

I know how to do this, but i am having difficulty finding the browser height. there are compatibility issue in IE, and also i am getting incorrect results. Please tell me the best way to achieve this
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
also check this post to get document height (cross-browser):
Get document height (cross-browser)
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

Open in new window