Is it possible to continuously adjust (I'm using setInterval) an iframe's height based upon the content within the iframe so that there would be no need for the iframe's y-scrollbar?
Here is my code so far:
This example works for the mainpage, but if you click on the "news" link, the iframe doesn't resize to fit the entire content. It seems to resize to just fit what is 'viewable'. Any ideas on how to make it so the iframe's height would extend to the iframe's content, making it so that the iframe's y-scrollbar would be unneccesary?
Thanks.
Here is my code so far:
Code:
<script type="text/javascript">
function changeWindowSize() {
i = document.getElementById("ifr")
i.style.height = i.document.body.offsetHeight;
}
</script>
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td width="100%" align="center">
<iframe id="ifr" src="[URL unfurl="true"]http://www.google.com"[/URL] marginwidth=0 marginheight=0 frameborder=0 scrolling="no" style="height: 600px; width: 850px;" onload="setInterval('changeWindowSize()', 2000);"></iframe>
</td></tr></table>
This example works for the mainpage, but if you click on the "news" link, the iframe doesn't resize to fit the entire content. It seems to resize to just fit what is 'viewable'. Any ideas on how to make it so the iframe's height would extend to the iframe's content, making it so that the iframe's y-scrollbar would be unneccesary?
Thanks.