re-size iframes to hold content without scrollbars
does anyone have any code, or know of where I can find some, I can insert into a page which will allow an iframe to resize its height to fit its content? I've spent a fruitless couple of hours searching but haven't found anything that does what it says on the tin yet.
beeswax
Re: re-size iframes to hold content without scrollbars
I'm pretty sure you have to set iframe widths and heights manually as it is essentially loading a separate frame (new browser window, in essence) of whatever content you tell it. If you really need what you're after, you should be able to achieve it with a DIV layer and some XMLHttpRequest to fetch the content.
Re: re-size iframes to hold content without scrollbars
I've googled it and seen a couple of ways it's supposed to work, one dhtml and the other javascript, but no matter how I try, I can't replicate it on my page(s).
Re: re-size iframes to hold content without scrollbars
A bit late but saw this whilst looking for something else :)
Code:
<iframe src="http://the website/websitefolder/webpage.htm" width="100%" height="1000" frameborder="0" scrolling="auto"></iframe>
I believe the bit you want is - scrolling="auto"