help with javascript - offsetheight different in i.e. and FF

Associate
Joined
4 Apr 2003
Posts
1,821
Location
Manchester
I am using the code below to set Div's to equal height

<script type="text/javascript">
var DivHeight = document.getElementById("content1").offsetHeight;
document.write(DivHeight)
document.getElementById("leftcol").style.height = DivHeight+"px";
</script>

My problem is ie is returning 649px which is correct yet FF ony 120?

The leftcol Div starts life as 1200px as declared in the css file

Thanks for any help
 
I'm no expert at javascript, but would this work

Code:
<script type="text/javascript">
document.getElementById("leftcol").style.height = document.getElementById("content1").offsetHeight."px";
</script>

or maybe this

Code:
<script type="text/javascript">
document.getElementById("leftcol").style.height = document.getElementById("content1").style.height;
</script>
 
Back
Top Bottom