[Sorry, I meant to start a new thread.]

When I use the following code to get the height of DIV that may of may not overflow, depending on the content, IE returns the larger height of DIV or contents. Whereas MZ and FF always returns the height of the DIV (100px). Is there a way to get MZ to return the height of the contents if the contents is larger than the height allocated to the DIV?

Andrew Poulos


<script type="text/javascript"> function sizer() { var obj = document.getElementById("myDiv").offsetHeight; alert(obj); } </script>

<style type="text/css">
#myDiv {position:absolute; left:100px; top:100px; width:100px; height:100px;}
</style>


</head>

<body onload="sizer()">

<div id="myDiv">
This is some sample text it is not meant to be read. This is some sample text it is not meant to be read.
</div>
******************************************************
The discussion list for http://webstandardsgroup.org/


Proud presenters of Web Essentials 04 http://we04.com/
Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to