Solved

changing web page row height dynamically

Posted on 2013-01-29
2
255 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

726 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