Firefox in need access to the height of the div, often need to use offsetHeight, sometimes encounter offsetHeight access to the phenomenon of 0,
in using Internet explorer or firefox, especially in the way of the div + CSS, often do not define the height of the div, this is after adding content div, need to get the height of the div, often need to use offsetHeight.

in use, sometimes encounter offsetHeight access to the phenomenon of 0, but if you use all JS debugging tool to debug, and sees the value in the object (point directly if offsetHeight is no value, but there is a value if it is object to view, enter in the debugger to view objects will have to refresh the object, so they have values.)

such as the following fragment

code is as follows:


code is as follows:


<! PUBLIC DOCTYPE HTML "-////W3C DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<Html>
<Head>
<Script language='javascript' >
window. AttachEvent (onload, function () {_resizeScroll2 ();});
window. Onresize=function () {winresize (); };
function _resizeScroll2 () {
var html1='<Div id="divcj" style="margin - top: 15px; the font - size: 10px; width: 400px;" >'+'
<Div style="float: left; width: 50px;" >Test </div> '+'
<Div style="float: left; width: 320px;" >Danielinbiti