PDA

View Full Version : scrollHeight


Danne
01-22-2003, 01:36 PM
Hi,

I'm trying to set the height of an iframe to the same as the height of the content.

I change the content using clientside code and DHTML (>IE5 only), reading data from another iframe. After doing that I change the height using the document.body.scrollHeight. This works fine when the content height is bigger than the previous. But when the content height is smaller than the previous - the scrollHeight remains bigger.

For example;

content height: 200px => scrollHeight: 200px
content height: 400px => scrollHeight: 400px
content height: 300px => scrollHeight: 400px

Is there a way to solve this problem, without counting the height of some elements inside the body?

Thanx in advance...