# IE7 and document.body.offsetHeight;

**URL:** <https://forum.kirupa.com/t/ie7-and-document-body-offsetheight/230712>\
**Category:** web dev\
**Created:** [June 28, 2007, 12:57pm UTC](https://forum.kirupa.com/t/ie7-and-document-body-offsetheight/230712 "2007-06-28T12:57:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darth](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@darth](https://forum.kirupa.com/u/darth)\
**Post date:** [June 28, 2007, 12:57pm UTC](https://forum.kirupa.com/t/ie7-and-document-body-offsetheight/230712/1 "2007-06-28T12:57:31Z")

</div>

I have this javascript code  
That I use to set flash height in html.  
It works but in IE7 it doesnt

alert shows that winH is 0

must I use something else instead of document.body.offsetHeight;?

```auto

if (parseInt(navigator.appVersion)>3) {
	if (navigator.appName=="Netscape") {
		winH = window.innerHeight;
	}
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		winH = document.body.offsetHeight;
	}
}
window.alert(winH+" "+flashH)

if(winH<flashH)
{
	setFlashHeight('flash_div',flashH);
} else {
	setHeightToPerc('flash_div');
}

```

Please help!
