Hi All,
I am working on site where I am using iframes for dynamic html files.
Each html file having own length and my iframe height is fixed.
How can I set auto height for each page coming in iframe?
- Jits
globtier.com
| SitePoint Sponsor |
Hi All,
I am working on site where I am using iframes for dynamic html files.
Each html file having own length and my iframe height is fixed.
How can I set auto height for each page coming in iframe?
- Jits
globtier.com
Globtier Solutions
Outsource IT Smartly


Without JavaScript it would be a little hard I don't quite follow exactly what you are after if the IFRAME is fixed it stays fixed.
The content file won't resize the IFRAME dimensions with HTML alone are you sure you want an IFRAME.
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?





This can be done using Javascript but I don't have a link at hand. Some Google searching should find an example of it.
A better alternative would be to use an include statement and just stick the html into your existing page. Although this is not always suitable.
An example of a PHP include statement:
Ryan,PHP Code:<?php require("blabla.html"); ?>

An 'iframe type display' with the scroll bar can be gained with CSS
CSS
HTMLCode:#fake_iframe { overflow: auto; height: 200px; width: 200px; }
Code:<div id="fake_iframe">Some content that will make a scroll bar appear if neccessary....</div>

Good point![]()
Yes, Ryanhellyer is saying right.
Sorry for not being clear!
When you put iframe somewhere to call any external file into that iframe, then you have to set iframe height. Right!
Now I want to set page height as per external page height so that no scroll appears around iframe.
And, my problem is that my contents are dynamic page height will vary page to page.
Is there any way to set iframe height on runtime automatically.
I had tried it by javascript but there was issue with OPERA browser.
Thanks
Jits
Globtier Solutions
Outsource IT Smartly
Bookmarks