Click to See Complete Forum and Search --> : Iframe w/o scrolling or similar?
thoer
12-01-2006, 07:57 PM
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)
http://i10.photobucket.com/albums/a112/romanemp/example.jpg
If clarification is needed, just let me know.
ray326
12-01-2006, 09:58 PM
Looks like a div with a defined width to me.
thoer
12-01-2006, 11:07 PM
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!
jakeman
12-01-2006, 11:22 PM
Try right clicking on frame and then on "Inline Frame Properities". Uncheck "Show borders", then select "Never" Scrollbars". This may work - good luck.
thoer
12-01-2006, 11:40 PM
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)
yitzle
12-02-2006, 09:08 PM
W3.org!
http://www.w3.org/TR/html4/present/frames.html#h-16.5
frameborder (1|0) 1 -- request frame borders? --
scrolling (yes|no|auto) auto -- scrollbar or none --
And try height=100% ?
blakeelias
12-02-2006, 09:22 PM
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.
yitzle
12-02-2006, 09:27 PM
That will set the height to a constant pixel size.
ray326
12-02-2006, 10:02 PM
<div style="width:500px; border:1px solid black">
your content
</div>
blakeelias
12-02-2006, 10:13 PM
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.
thoer
12-03-2006, 12:19 AM
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!
thoer
12-04-2006, 10:21 PM
*bump*
ray326
12-05-2006, 10:02 AM
I think that will be pretty tough given the forum will actually be a form posting back to the host.
WebJoel
12-06-2006, 11:39 AM
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="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.
WebJoel
12-06-2006, 04:29 PM
wow... I might have to use this. :D
thoer
12-09-2006, 12:45 PM
Thanks 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://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.
thoer
12-11-2006, 07:28 PM
*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.
thoer
12-12-2006, 02:57 PM
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?
thoer
12-16-2006, 11:38 PM
Any luck?