IE Clientheight Problem

Nov 15, 2006

I'm trying to dynamically change the height of a div, and I have it
working in Firefox, but IE isn't letting me get the clientHeight of the
div. When I do an alert to check the clientHeight of the div, it tells
me 0.

Here is the function (at least the part that tries to get the height):

function resizeDivs(divnum){
var branddivid = 'branddiv' + divnum;
var branddiv = document.getElementById(branddivid);
var divheight = branddiv.clientHeight;
alert(divheight);
}

View 1 Replies


ADVERTISEMENT

ClientHeight Not Supported By FF

May 7, 2007

<script type="text/javascript">
var tdLeftheight, tdRightHeight;
tdLeftheight=document.getElementById("tdLeftContent").clientHeight;
tdRightHeight=document.getElementById("tdSidePanelLinksUP").height;
//alert(tdLeftheight +' '+tdRightHeight);
document.getElementById("tdSidePanelLinksDown").style.height= tdLeftheight-tdRightHeight;
</script>

The clientHeight attribute is not supported by FF. Any alternative to this?

View 3 Replies View Related

ClientHeight Check Not Working In IE?

Jan 23, 2009

I'm trying to check the client's window height and then apply some proper css in some div classes. The code I use does not work in IE6 and IE7.

<body onload="document.write(document.documentElement.clientHeight);">

I resize the window, I refresh the page and the height that the code returns, remains the same. I searched about it in google and it seems that the document.documentElement.clientHeight is compatible with IE, so I don't understand why is this happening

View 1 Replies View Related

ClientHeight Returns Not As Expected?

Dec 20, 2009

I want to know how to find out the viewport height in IE. I have been trying to use document.body.clientHeight, which is supposedly exactly what I am after, but the results were always way too small to be the correct one.

As a test, I whacked a div in my page and made it 4000px tall, and ran document.body.clientHeight from IE's debugger and it returned a number over 4000px. It seems as thought clientHeight is actually returning the total height of the document, not the viewport size.

View 4 Replies View Related

Use Clientheight To Style Innerhtml Div?

Aug 24, 2011

I've read that clientheight is read only so I'm wondering if you can style the div within the 'client' to match it's height and width properties so that no scrollbars appear when the screen is smaller.

HTML Code:
<div id="div1">//clientheight and clientwidth I want to match
<div id="div2"></div>//height and width needs to match parent div
</div>

[Code]...

I'm guessing everybody can see what I'm trying to do. Please let me know if there is a way to do this.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved