Jump to content

Auto Height Adjust For Iframe.


novartic

Recommended Posts

I've been trying this out, and it worked in browsers listed in comments. I don't have IE8 installed so if you could test it, this might be the way to go.<script type="text/javascript"><!--//function sizeFrame() { var F = document.getElementById("myFrame"); if(F.contentDocument) { F.height = F.contentDocument.documentElement.scrollHeight; //FF 3.0.11, Opera 9.63, and Chrome } else { //F.height = F.contentWindow.document.body.offsetHeight; //IE6, IE7 only F.height = F.contentWindow.document.body.scrollHeight; //IE6, IE7 and Chrome } } window.onload=sizeFrame; //--></script><iframe width="100%" id="myFrame" src="iframepage.htm" scrolling="no" frameborder="0">

Link to comment
Share on other sites

scrollbars in IE?try setting scrollbars to no, to see if fixes the problem. also the height in iframe might be cancelling out javascript height setting.if you require scrollbars for non javascript browsers, try setting the scrollbars to 'no' using javascript (think this can be done, sure it can) then non javascript will have scrollbars="auto" (with the height you have defined) by default.

Link to comment
Share on other sites

Found that there were some odd things in the code that upset the JS. Its fixxed now. Though some other docs stil have this same issue so im just going to +30 at the end again.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...