Solved

changing web page row height dynamically

Posted on 2013-01-29
2
254 Views
Last Modified: 2013-02-04
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
0
Comment
Question by:RTKHOT
  • 2
2 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 300 total points
ID: 38830609
did u try use window dimensions:

var totalWidth = $(window).width() 
var totalHeight = $(window).height()

Open in new window

0
 
LVL 42

Expert Comment

by:sedgwick
ID: 38830611
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

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question