Log in

View Full Version : Resolved iframe fluid height?



AlterPoser
02-12-2009, 09:10 AM
Is there a way were I can have fluid height on an iframe? My site is just basically and iframe and I don't want to have to add a scroll box on my site, well two of them.


<iframe src="http://twitter.com/alterposer" style="width: 100%; height:1500px" name="internal"
scrolling="yes" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0">
</iframe>

I also wanted to ask if there's a way to make a CSS column to have fluid height was well. I want to keep the fixed width though.


#leftcolumn {
color: #000;
border: 1px solid #080808;
margin: 0px 5px 5px 0px;
padding: 10px;
height:1500px;
width: 955px;
float: left;
background: #080808;
}

Any help would be great.

Thanks.
Ap

AlterPoser
02-12-2009, 09:16 AM
So basically I'm an idiot because I was looking at the code and then I was like OHHH just change the px to 100% and I assumed to do the same thing with the CSS part but it didn't really work. So can any help on that one instead?

Thanks,
Ap

NDK
02-12-2009, 09:32 AM
don't think it's possible for an iframe, not sure

AlterPoser
02-12-2009, 11:00 AM
Okay so I was looking around the main site and found THIS (http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm#). Is there a way to combine this with the iframe??

@NDK (http://www.dynamicdrive.com/forums/member.php?u=37147) thanks anyways

fobos
02-22-2009, 12:20 AM
Why dont you use auto iframe height on content load?

What i am talking about is this. This will go in the head section of your main page.



<script>
function adjust_iframe_right_height(h) {
if (h==0)
document.getElementById("iframe name").src = document.getElementById("iframe name").src;
document.getElementById("iframe name").style.height = h;
}
</script>


Then for each page that is going to be loaded in the iframe use this code



<script>
function adjust_Size() {
parent.adjust_iframe_right_height(document.body.scrollHeight);
}
</script>
<body onLoad="adjust_Size();">

AlterPoser
05-10-2009, 06:59 PM
Thanks that's really helpful. Dang srry for the late reply.