Advertisement

06.09.2008 at 09:16AM PDT, ID: 23469586
[x]
Attachment Details

Set height of Div element (for all browsers)

Asked by dds110 in JavaScript, Web Languages/Standards, Web Browsers

Tags: javascript height property of div cross browser compatibility, IE, NN, FF

Hi all,

Please see the attached code snippet.  I'm trying to resize a div element to take up all available screen space to minimize scroll bars.  This works fine in IE but  not in NN or FF.  Can anyone push me in the right direction?

Thanks,

dds

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function resizeContent()
{
    var NS = document.all;
    try
    {
        document.getElementById("divContent").style.height=(!NS)?window.innerHeight - 85:document.body.clientHeight - 85;
        //document.getElementById("tdContent").style.height=(!NS)?window.innerHeight - 101:document.body.clientHeight - 101;
    }
    catch(err){alert(err);}
}
[+][-]06.09.2008 at 09:18AM PDT, ID: 21744379

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.09.2008 at 11:48AM PDT, ID: 21745561

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Web Languages/Standards, Web Browsers
Tags: javascript height property of div cross browser compatibility, IE, NN, FF
Sign Up Now!
Solution Provided By: ankitkumar29
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628