View Full Version : An iframe question-
Ice Crystals 07-15-2003, 05:27 PM Can anybody tell me how you can make an iframe that automatically resizes to fit the size of the browser screen? I found an example of it here
http://echoica.net/schism.html
If you resive te window, the iframe with the text in it resizes with it. Is that javascript? Or a code in the frame? Does anyone know?
Ice Crystals 07-15-2003, 05:30 PM I think that it has something to do with frames, is that right? The ones that take up the whole page.
kittycat 07-15-2003, 05:33 PM That one is in a frameset. I think if you use percents for width/height instead of actual pixels it might work the same way.
briankircho 07-15-2003, 05:34 PM The example you gave is using regular frames yes. But you could specify the width of iframes with % just like anything else, so for example
<iframe src="#" width="100%" height="100%"></iframe>
would make a frame take up the whole page.
Ice Crystals 07-15-2003, 06:05 PM Hmmm ok...
But could you do that with just an iframe? Like I have an iframe that is absolutely positions from the left, and depending on the size of the brower, i want the iframe to automatically stretch all the way to the right side. You know what I mean? How could you do that, or can you even? I tried to do width="100%", but that of course doesn't work because it makes it the length of the entire browser width.
briankircho 07-15-2003, 06:17 PM If i understand you then does this work?
<div style="position: absolute; top:300; left:300;">
<iframe src="http://" width="100%" height="400"></iframe>
</div>
MaGiCSuN 07-15-2003, 06:26 PM remember that width and height = 100% will fit to the whole screen, unless you use some kind of table around it, so it will fit to the table size.
Love,
Mirna
Ice Crystals 07-15-2003, 07:26 PM Yeah, the width="100%" doesn't work. Oh well. Thanks for the help :)
Ice Crystals 07-16-2003, 01:29 AM Can someone tell me what is wrong with this code:
<frameset cols="473,*" scrolling="no" frameborder="0" border="0">
<frame src="http://www.midnight-myst.net/~e/left.html" name="left">
<frameset rows="55,325,*" frameborder="0" border="0">
<frame src="http://www.midnight-myst.net/~e/right1.html" name="1">
<frame src="http://www.midnight-myst.net/~e/right2.html" name="2">
<frame src="http://www.midnight-myst.net/~e/right3.html" name="3">
</frameset>
</frameset>
And of course it has my body, html tags and stuff around it... but when I put it in nothing at all shows up on the page. The frame on the left has a set width, and is supposed to go all the way down the length of the page. The other set is there was more frames aligned vertically on the right side. The first two have a set vertical width. The third one is supposed to go all the way the rest of the length of the page. All three of the ones on the right are supposed to fill up the rest of the page to the right. Um... ok I know I'm missing some codes probably.. but... can anyone help?
MaGiCSuN 07-16-2003, 04:45 PM your order from your page should not be:
<html><head>
<title>title here</title>
</head>
<body>
frameset here</body></html>
but
<html><head>
<title>title here</title>
</head>
frameset here
<body>
</body>
</html>
so this:
<html>
<head>
<title> title here </title>
</head>
<frameset cols="473,*" scrolling="no" frameborder="0" border="0">
<frame src="http://www.midnight-myst.net/~e/left.html" name="left">
<frameset rows="55,325,*" frameborder="0" border="0">
<frame src="http://www.midnight-myst.net/~e/right1.html" name="1">
<frame src="http://www.midnight-myst.net/~e/right2.html" name="2">
<frame src="http://www.midnight-myst.net/~e/right3.html" name="3">
</frameset>
</frameset>
<body>
</body>
</html>
placing framecodes into the <body> tag will not work. Why? i have no idea really, it's just a weird thing
Love,
Mirna
Ice Crystals 07-16-2003, 05:27 PM Thank you!!! ^_^
Would you by any chance know then how to get my scroller transparent? Um... ok, in the right2.html page that opens up, I had used this code for getting the scroller transparent and I'd put it into the iframe tag that it opened up in before...:
allowtransparency="true" style="filter:chroma(color=#1F1D2F);"
Except, I put this into the frame thing on my index page for that particular frame, and where I put the color that's supposed to not appear, it's white. Is it the wrong code? Or does that just not work. I also tried putting some of the variables of the scroller down as 'transparent', but that didn't work too good either :S
MaGiCSuN 07-16-2003, 05:31 PM put this into your <iframe> code:
allowtransparency="true" style="filter:chroma(color=#1F1D2F);"
take out the space between style=" and filter, it should be style="filter" and not style=" filter"
then put the following on the page where the <iframe> code is located on between the <head> and </head>:
<style type="text/css">
<!--
.iframe {scrollbar-face-color : #000000;
scrollbar-highlight-color : #000000;
scrollbar-3dlight-color : #000000; scrollbar-shadow-color : #000000;
scrollbar-darkshadow-color : #000000; scrollbar-track-color : #000000;
scrollbar-arrow-color : #000000;}
-->
</style>
and add class="iframe" to your iframe code like this:
<iframe class="iframe">
then change all the colours in the scrollbar coding to #1F1D2F except for the arrows. leave those another colour
Love,
Mirna
MaGiCSuN 07-16-2003, 05:53 PM forget about the class
add the following code into your <iframe>
allowtransparency="true" style="filter:chroma(color=#1F1D2F);"
take out the space after style=" and before filter
then add on all the pages that open into the iframe this:
<style type="text/css">
<!--
body {scrollbar-face-color : #1F1D2F;
scrollbar-highlight-color : #1F1D2F;
scrollbar-3dlight-color : #1F1D2F; scrollbar-shadow-color : #1F1D2F;
scrollbar-darkshadow-color : #1F1D2F; scrollbar-track-color : #1F1D2F;
scrollbar-arrow-color : #000000;}
-->
</style>
between the <head> and </head>. Sorry for my mistake!
Love,
Mirna
|