Iframe Help!!!! PLEASE!

liunx

Guest
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? <br />
<br />
<br />
If anyone has a solution or a Script I'm seriously begging you for it!!! Thanks in Advance!<!--content-->this will work for ya<br />
you must set the height and width to what you need it to be.<br />
the scrolling attribute can only be set to "auto"; "yes"; or "no".<br />
<br />
<html><br />
<head><br />
<title></title><br />
<script language="JavaScript" type="text/JavaScript"><br />
<!--<br />
function resize(obj,w,h){<br />
if (document.getElementById || document.all) {<br />
SD = document.getElementById(obj).style || document.all[obj].style;<br />
}<br />
SD.width = w;<br />
SD.height = h;<br />
}<br />
//--><br />
</script><br />
</head><br />
<body><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.#.com" target="myFrame" onClick="resize('myFrame',400,400)">link</a><br><br />
<iframe src=http://www.webdeveloper.com/forum/archive/index.php/"none" frameborder="1" scrolling="no" name="myFrame" id="myFrame"></iframe><br />
</body><br />
</html><!--content-->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!<!--content-->i don't think it is possible; who knows maybe sombody can figure it out<!--content-->What???<br />
<br />
Load a page in the iframe<br />
<br />
Option 1 -- make your Iframe bigger <br />
Option 2 -- load the page in a new window<br />
<br />
or just put up with a scorll bar that allows the user to see the whole page<br />
<br />
OH.. Scrolling is YES and NO only<!--content-->What???<br />
<br />
Load a page in the iframe<br />
<br />
Option 1 -- make your Iframe bigger <br />
Option 2 -- load the page in a new window<br />
<br />
or just put up with a scorll bar that allows the user to see the whole page<br />
<br />
OH.. Scrolling is YES and NO only<!--content-->Take a look at <!-- w --><a class="postlink" href="http://www.xstem.com">www.xstem.com</a><!-- w -->, 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.<!--content-->The technique of split and DESTROY! I mean CONQUER!<br />
<br />
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.<br />
<br />
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.<br />
<br />
Try this.<!--content-->
 
Back
Top