views:

34

answers:

1

Hey guys long time reader first poster. Well I seem to be having an iFrame resize issue with Google Chrome.

> <script language="javascript" type="text/javascript">
 function resizeIframe(obj)

 {
   obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';


     }
 </script>

<

That's in my header.

> <iframe id="content" name="content" frameborder="0" scrolling="no" width="950px" src="html/index2.html" onload='javascript:resizeIframe(this);'></iframe> <

That is my iframe script.

So what I'm trying to do is to resize the iFrame dynamically per page content, and it works flawlessly in Firefox & IE, but not Chrome. What gives? Any ideas guys?

Thanks in advance.

A: 

It appears that this is a bug with chrome. Why can't you use clientHeight for now instead of scrollHeight?

Alex
Thanks for the quick reply!Tried that and it didn't work in chrome, yet again. I'm a bit of a noob with it comes to javascript and im trying to use a setTimeout because my recent research suggests something about chrome loading the javascript too fast? I can't seem to get the setTimeout to work!
IOWA