Code Help...Iframe. I'm Close...

bigg_capp

Regular Member
Joined
Aug 24, 2010
Messages
486
Reaction score
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:

Code:
<iframe id="MyIFRAME" name="MyIFRAME"      src="http://www.yahoo.com"     scrolling="auto" width="100%" frameborder="0">     no iframes supported... </iframe>
And put this code in my Page html portion

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>
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
 
Do this instead:
HTML:
<html>
<head>
	<title>Full page frame</title>
	<style type="text/css">
	html, body{
		margin:0;
		padding:0;
		overflow:auto;
	}
	</style>
</head>
<frameset rows="100%, *" border="0" framespacing="0" frameborder="0">
	<frame noresize="" src="http://www.yahoo.com/"></frame>
</frameset>
</html>
 
YESSS!!

Thanks artizhay! That shit worked like a f*ckin' charm!! OMG!
Rep and thanks giving. Now I can go out with my girlfriend without being pissed off. lol. ......but of course, now I don't want to go because I have work to do with my iframe!!

Thanks Again and Happy New Year!!
-Capp
 
YESSS!!

Thanks artizhay! That shit worked like a f*ckin' charm!! OMG!
Rep and thanks giving. Now I can go out with my girlfriend without being pissed off. lol. ......but of course, now I don't want to go because I have work to do with my iframe!!

Thanks Again and Happy New Year!!
-Capp
You're welcome. Have a good night and a happy new year!
 
Back
Top