HI there. I am looking to try and figure out how to change the height of an iframe everytime a new page is loaded inside of it. I currently can change it onLoad of the initial iframe but not after something else is loaded inside of it. Here is what I currently have
Then the actual iframeCode:<script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('iframe').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('iframe').height= the_height; } //--> </script>
Any help would be great. Thank you.Code:<iframe onLoad="calcHeight();" width="600" id="iframe" src="somepage.php" scrolling="NO" frameborder="0" height="100">An iframe capable browser is required to view this web site.</iframe>



Reply With Quote


Bookmarks