Click to See Complete Forum and Search --> : Iframe Help!!!! PLEASE!


Xstem
12-11-2002, 09:39 PM
Ok this is what I need...Lets say I have a page with an iframe on it. And I click a link that loads in the iframe, but the page that is loading in the iframe is bigger then the iframe so it will obviously have scrollbars in it. I'm trying to find a script that will stretch the iframe to the exact size of the page that is being loaded in it, so there is no need for any iframe scrollbars... if your wondering if I should do scrolling="0", That won't work because the whole page is still not visible in the iframe know what I mean?


If anyone has a solution or a Script I'm seriously begging you for it!!! Thanks in Advance!

ShrineDesigns
12-13-2002, 01:07 AM
this will work for ya
you must set the height and width to what you need it to be.
the scrolling attribute can only be set to "auto"; "yes"; or "no".

<html>
<head>
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
function resize(obj,w,h){
if (document.getElementById || document.all) {
SD = document.getElementById(obj).style || document.all[obj].style;
}
SD.width = w;
SD.height = h;
}
//-->
</script>
</head>
<body>
<a href="http://www.#.com" target="myFrame" onClick="resize('myFrame',400,400)">link</a><br>
<iframe src="none" frameborder="1" scrolling="no" name="myFrame" id="myFrame"></iframe>
</body>
</html>

Xstem
12-13-2002, 02:53 PM
Thanks, The script does work, but instead of putting in the exact page height/width for every page, is there anyway to edit the script to make it recognize the size of the page that is being loaded in it automatically?? Thank again!

ShrineDesigns
12-13-2002, 07:49 PM
i don't think it is possible; who knows maybe sombody can figure it out

DUMD-DO
12-24-2002, 12:07 AM
What???

Load a page in the iframe

Option 1 -- make your Iframe bigger
Option 2 -- load the page in a new window

or just put up with a scorll bar that allows the user to see the whole page

OH.. Scrolling is YES and NO only

DUMD-DO
12-24-2002, 12:16 AM
What???

Load a page in the iframe

Option 1 -- make your Iframe bigger
Option 2 -- load the page in a new window

or just put up with a scorll bar that allows the user to see the whole page

OH.. Scrolling is YES and NO only

Xstem
12-26-2002, 01:50 PM
Take a look at www.xstem.com, and see why I needed that script. If you can figure it out good, if you can't too bad I'm not going to explain it.

King Pellinore
12-26-2002, 09:59 PM
The technique of split and DESTROY! I mean CONQUER!

First, determine if you can find the width of the window from inside the window. Like, if you have a table (with everything else inside) with a fixed width, use JavaScript to find out its width and height.

Then, from the page you load, you can control the iframe size by sayingtop.iframename.width=thewidth;and similar for the height. top here means the top element, as you might have guessed.

Try this.