Solved

changing web page row height dynamically

Posted on 2013-01-29
2
251 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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now