Scripts: Javascript :: Forms :: Library Article #29
Developer's Section
![]() By: Erobo Team Member
|
|||
![]()
Sometimes when working with Doctype documents you will come across instances where innerHeight and offsetHeight properties of an html element return a 0 value. This usually happens when some of the elements on the html document have a display:none style and are configured to show on hover. Also, sometimes this case is seen on floating elements, and divs with position:absolute style.
test
innerHeight or offsetHeight of some content inside To solve this issue, you could create a helper DOM element that matches the style of the element that you are trying to calculate the height for. Inserting it at the beginning of the document. Calculating the height, and then removing it completes the process easily. Thus providing a convenient way of achiving this goal without any major implications. See Code Below: |
|||
|
|||
![]() |
|
System Message:
|
![]() the form below: |