View Full Version : Iframe resizing dynamically to browser page size
crioux
10-16-2006, 02:51 PM
Is there a way to resize an iframe dynamically to fit the browser`s size ?
I can do it with tables and frames, but not with iframe. Why?
djr33
10-16-2006, 05:26 PM
Are percent width/heights valid in iframe tags?
<iframe width="100%" height="5%">
whatever you want... should work.
Unless percents aren't valid, which they might not be. I think they are, though.
crioux
10-16-2006, 07:14 PM
I did try that, and it did not work.
The frame is within a table, maybe it has something to do with it.
Here the test page of what I'm trying to accomplish, the white box is the iframe
http://gaspe.cgaspesie.qc.ca/mineralogie/index2.php
here is the line of code:
<? echo '<iframe id="myframe" src="' . $contenu . '" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; height:100%; display:none"></iframe>'; ?>
and I did try with the line :
<? echo '<iframe src="' . $contenu . '" width=100% height=100% frameborder="0"></iframe>'; ?>
and got the same result.
I want to get rid of the buttons that adjust the page size manually, like in the original site :
http://gaspe.cgaspesie.qc.ca/mineralogie
crioux
10-16-2006, 08:45 PM
I did find a script with javascript that work. There are still some rough edges, but I think I will be able to work out something out of it.
Here it is:
http://www.dyn-web.com/dhtml/iframes/
Thanks.:)
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.