bigg_capp
Regular Member
- Aug 24, 2010
- 486
- 413
Ok, I'm no expert, but I have been trying to Iframe a full website and it's driving me crazy.
I used this code, I put this in my header:
And put this code in my Page html portion
Here is the result I got: http://freeformula.justmho.com/?page_id=179
Really close but no cigar. I can't get the height to auto resize.
Any help with this? I also tried to use the code in this thread but couldn't get it to work either.
If anyone can help a brotha out that would be great.
-Capp
I used this code, I put this in my header:
Code:
<iframe id="MyIFRAME" name="MyIFRAME" src="http://www.yahoo.com" scrolling="auto" width="100%" frameborder="0"> no iframes supported... </iframe>
Code:
<!-- ... -->
<body>
<script type="text/javascript">
function resizeIframe() {
var docHeight;
if (typeof document.height != 'undefined') {
docHeight = document.height;
}
else if (document.compatMode && document.compatMode != 'BackCompat') {
docHeight = document.documentElement.scrollHeight;
}
else if (document.body
&& typeof document.body.scrollHeight != 'undefined') {
docHeight = document.body.scrollHeight;
}
// magic number: suppress generation of scrollbars...
docHeight += 20;
parent.document.getElementById('MyIFRAME').style.height = docHeight + "px";
}
parent.document.getElementById('MyIFRAME').onload = resizeIframe;
parent.window.onresize = resizeIframe;
</script>
</body>
Really close but no cigar. I can't get the height to auto resize.
Any help with this? I also tried to use the code in this thread but couldn't get it to work either.
If anyone can help a brotha out that would be great.
-Capp