PDA

View Full Version : Growing frame


Cmoazz
11-12-2005, 02:05 AM
Ok, first, go look at site and source.
www.305kicks.com/index2.html

Ok, now then... as you can see I use frames. Is there a way to have the frames adjust to the height of the page its opening? So that the page "grows" so it wont need a scroll bar? For lenghtwise..... not width.

Would be much appreciated, thanks.

_Aerospace_Eng_
11-12-2005, 03:22 AM
http://www.htmlforums.com/showthread.php?t=65552

Cmoazz
11-12-2005, 10:30 AM
Hey I tried it but it didnt work, I dont really understand the post....

This is what I did.

Grabbed the last code provided and put inside the <head> of the pages that were being iframed. Then when you open the main page, theyre still boxed in with a scroll bar, what did I miss?

Cmoazz
11-12-2005, 10:34 AM
I got the <styles> from iframe(from thread) and put in my main page....
Then I put test.html(from thread) in my page that appears in the frame.

Still scrolls..... help?

_Aerospace_Eng_
11-12-2005, 12:37 PM
Did you include the javascript in your test.html page?

Cmoazz
11-12-2005, 02:28 PM
Sorry im kind of lost, can you repost code that goes into the UNCHANING page, and the one that goes into the FRAMED page....

I think im saying it right. I learn best by people reposting the HTML correctly.... so I can examine it and see what I did wrong. Just the way I learn i guess.

_Aerospace_Eng_
11-12-2005, 02:51 PM
Sighs. It was already posted. I guess I'll post it again. It does help to actually READ what the posts tell you.
THIS is the page that contains the iframe
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ifame page</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<meta name="Content-Style-Type" content="text/css"/>
<style type="text/css">
/*<![CDATA[*/
body {
background-color:#999;
color:#000;
}
#frameholder {
width:600px;
border:3px double #000;
background-color:#fff;
color:#000;
margin:50px auto;
}
#theframe {
width:600px;
height:500px;
border:none;
}
a {
background-color:inherit;
color:#000;
}
/*//]]>*/
</style>

</head>
<body>

<div>
<a href="test.html" target="theframe">test.html</a>
</div>

<div id="frameholder">
<iframe id="theframe" name="theframe" src="http://www.google.com" scrolling="no"></iframe>
</div>

</body>
</html>
THIS is the basic setup for the pages that will be the src of the iframe.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<meta name="Content-Script-Type" content="text/javascript"/>
<meta name="Content-Style-Type" content="text/css"/>
<style type="text/css">
/*<![CDATA[*/
body {
margin:0px;
padding:0px;
}
#container {
width:400px;
padding:20px;
background-color:#fff;
font-family:verdana,arial,helvetica,sans-serif;
font-size:16px;
color:#000;
}
#container p {
margin:0px;
padding:10px;
border:1px solid #000;
text-align:justify;
}
/*//]]>*/
</style>

<script type="text/javascript">
//<![CDATA[
function resizeIframe() {

parent.document.getElementById('frameholder').style.width=
parent.document.getElementById('theframe').style.width=
document.getElementById('container').offsetWidth+'px';

parent.document.getElementById('frameholder').style.height=
parent.document.getElementById('theframe').style.height=
document.getElementById('container').offsetHeight+'px';

}
onload=resizeIframe;
//]]>
</script>

</head>
<body>

<div id="container">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent blandit venenatis purus.
Integer massa libero, vehicula id, consequat sed, tincidunt nec, purus. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Suspendisse potenti.
Nunc vulputate magna non magna. Aenean lorem eros, adipiscing quis, semper non, dictum a,
nunc. Curabitur ut sem. Pellentesque a est id neque hendrerit ultrices. Donec vulputate tincidunt
turpis. Curabitur dignissim vestibulum nunc. Aliquam felis lorem, ultrices sit amet, convallis a,
accumsan vel, ante. Proin aliquam turpis sed augue. In pellentesque, magna a pulvinar adipiscing,
est orci adipiscing felis, sed laoreet urna magna quis neque. Proin facilisis aliquet urna.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Sed
cursus feugiat mauris. Aenean pharetra purus a augue varius gravida. Aliquam gravida nibh ut nunc.
Integer tortor risus, posuere eget, rutrum non, semper a, tellus. Phasellus faucibus, elit nec egestas
adipiscing, sapien sapien lacinia nulla, et bibendum metus neque fermentum sapien. Etiam ante dui,
tincidunt ac, auctor eu, aliquet non, velit. Mauris enim libero, malesuada at, dignissim vitae, lobortis ut,
enim. Sed porttitor consequat eros. Morbi nec risus vitae diam sodales accumsan. Praesent ultrices
magna sit amet enim. Proin convallis ipsum non dolor. Donec eu tellus. Nam ut magna.
</p>
</div>

</body>
</html>
Where your content goes INSIDE of the div with id="container"

Cmoazz
11-12-2005, 06:19 PM
That didnt work... all it did was make the scroll bar invisible. What do I put for height=" " for the table.... and all the other things. Can you just post it for me... using these.

www.305kicks.com/index2.html <--- outer frame

www.305kicks.com/main.html <-- one of the frames thats inside index2.

Please... thanks.

Cmoazz
11-13-2005, 05:13 PM
Still not working, im not sure if you noticed but my pages are inside a table, I think I have to set the height=" " attribute to something for that to work?

I noticed it takes the scroll bars away.... but the page doesnt grow past your page settings, just makes it scrollable with no bars, making them invisible.

Does this have something to do with the table?