Iframe w/o scrolling or similar?

liunx

Guest
I want to put a frame around my forum but I don't want there to be any scroll bars- instead I wand the frame height to adjust to the forum's size.

Perhaps Iframe are not the correct thing to use, but I need something that will give the same effect.

So, (1) no scroll bars and (2) I want the height to autostrech according to the forum's size (while maintaining a constant defined width).

See example: (Forum is cyan part, white is the frame I want to put around it)

<!-- m --><a class="postlink" href="http://i10.photobucket.com/albums/a112/romanemp/example.jpg">http://i10.photobucket.com/albums/a112/ ... xample.jpg</a><!-- m -->

If clarification is needed, just let me know.Looks like a div with a defined width to me.Thanks for the reply!

I'm familiar with the dir tag, but didn't know it could be used for something such as this :) Perhaps you could elaborate? What would be the code for it?

Thanks for the help!Try right clicking on frame and then on "Inline Frame Properities". Uncheck "Show borders", then select "Never" Scrollbars". This may work - good luck.Hmmm, what HTML software are you using? I use Nvu and it's not possible to do what you say :) If you know the code though, I could use that.

If not, perhaps the div thing will still work (if someone can post the code)W3.org!
<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/present/frames.html#h-16.5">http://www.w3.org/TR/html4/present/frames.html#h-16.5</a><!-- m -->
frameborder (1|0) 1 -- request frame borders? --
scrolling (yes|no|auto) auto -- scrollbar or none --
And try height=100% ?Try this inside of your framed page:
<div style="width:---px"></div>
Replace --- with the width that you want (in pixels). The height should auto-adjust.That will set the height to a constant pixel size.<div style="width:500px; border:1px solid black">
your content
</div>Rather than using IFRAME, surround your content with this:

<div style="WIDTH:120px; border-style: inset; border-color: lightgray; border-width: 2px;">

and

</div>


Change the width from 120px to any width you want. The DIV element will automatically resize, unlike IFRAME.Thanks for the replies! One question though- how do I get the div to display my forum inside it? All I can manage to do is put some of my own content right now- I want my forum (hosted on invisionfree's server) to fill the div area like displayed in the picture.

Thanks again for the help!*bump*I think that will be pretty tough given the forum will actually be a form posting back to the host.The only way you're going to get content from 'point B' inserted into document page 'point A' without a scrollbar, and have it expand to accomodate increasing content from 'point B', might be to use a *php include. That way, the content from 'B' is referanced to appear in 'A' and if 'B' gets taller, if you style 'A' correctly, it should accomodate.
Anything else (like a iFRAME maybe or <object> of sure, is going to by default always add at least a vertical scrollbar... even if it is 'shadowed out'.
Esp. true for IE6, which tends to put a scrollbar on <object> and nothing willl prevent this.you can recalculate the iframe size using an "onLoad" javascript event. i just had to do this recently on one of my sites as well and it works great. the iframe tag looks like this:

<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"whatever.htm" name="ThisFrame" width="500" height="100%" scrolling="no" frameborder="0" onLoad="calcHeight()">
Your browser does not support inline frames.</iframe>

particularly pay attention to the onLoad="calcHeight()" function. your javascript then looks like this:

function calcHeight()
{
var the_height=
document.getElementById('ThisFrame').contentWindow.document.body.scrollHeight;
document.getElementById('ThisFrame').height=the_height;
}

notice that the name of the iframe must correspond to the "getElementByID()" in the javascript.wow... I might have to use this. :DThanks for the reply! I tried your code, but unfortunately it didn't work for some reason :( It still doesn't auto-calculate the height of the forum. This is a simple test using the code (what I did to see if it would work). Did I do something wrong?

<html>
<head>
<script language='Javascript' type='text/javascript'>
function calcHeight()
{
var the_height=
document.getElementById('ThisFrame').contentWindow.document.body.scrollHeight;
document.getElementById('ThisFrame').height=the_height;
}
</script>
</head>
<body>
<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"http://s12.invisionfree.com/Roman_Empire/index.php?act=idx" name="ThisFrame" width="760" height="100%" scrolling="no" frameborder="0" onLoad="calcHeight()">
Your browser does not support inline frames.</iframe>
</body>
</html>

That is the forum I want to display just so you know too.*bump*ahh you know i forgot to say that this only works in IE... not sure if that's the problem for you.oh and it appears your problem is getting a webpage from a different domain than the one you are calling the page from... it's a built-in security measure. looking for a work-around right now.Thanks, I'll be watching to see if you find a solution!

ahh you know i forgot to say that this only works in IE...

I'm assuming there's no way to make it firefox compatible?Any luck?
 
Back
Top