davebeseke
11-12-2005, 01:52 PM
I am having a problem with a website that uses Iframes. Here is what I am trying to do:
1. The Iframe height must be able to be dynamically resized to fit the contents. We do not want to have a situation where we end up with a scrollbar on the Iframe and a scrollbar on the browser.
2. The height required for the content pages will change based on which page we are loading into the Iframe. It may become shorter or longer. The page that contains the Iframe has some additional contents under the Iframe. We want those contents to appear immediately under the Iframe without any gap between the bottom of the Iframe and the top of the outer page's content.
3. The pages displayed inside the content may be from the same domain as the container page, or they may be loaded from a completely different domain. The user will be clicking on navigational links within the content inside the Iframe that may cause pages to load from other domains as well. The behavior of the Iframe must remain consistent in either case.
Here is an example of how we are currently constructing the page (***DYNAMIC CONTENT*** is the page that we swap):
Main page:
<html>
<BODY>
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="15%" align="left" bgcolor="#F1F1F1">content</td>
<td width="85%" align="right" valign="bottom">content</td>
</tr>
<tr>
<td width="15%" valign="top"><iframe src="xxxx" frameborder="0" width="100%"></iframe></td>
<td width="85%" valign="top" align="left"><iframe src="***DYNAMIC CONTENT***" frameborder="0" width="100%"></iframe></td>
</tr>
<tr height="75">
<td width="15%">bottom content</td>
<td width="85%">bottom content</td>
</tr>
</table>
</body>
</html>
***DYNAMIC CONTENT*** may be replaced by another URL from the same domain as the main page or it may be a URL to a page in another domain.
Any help would be greatly appreciated.
1. The Iframe height must be able to be dynamically resized to fit the contents. We do not want to have a situation where we end up with a scrollbar on the Iframe and a scrollbar on the browser.
2. The height required for the content pages will change based on which page we are loading into the Iframe. It may become shorter or longer. The page that contains the Iframe has some additional contents under the Iframe. We want those contents to appear immediately under the Iframe without any gap between the bottom of the Iframe and the top of the outer page's content.
3. The pages displayed inside the content may be from the same domain as the container page, or they may be loaded from a completely different domain. The user will be clicking on navigational links within the content inside the Iframe that may cause pages to load from other domains as well. The behavior of the Iframe must remain consistent in either case.
Here is an example of how we are currently constructing the page (***DYNAMIC CONTENT*** is the page that we swap):
Main page:
<html>
<BODY>
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="15%" align="left" bgcolor="#F1F1F1">content</td>
<td width="85%" align="right" valign="bottom">content</td>
</tr>
<tr>
<td width="15%" valign="top"><iframe src="xxxx" frameborder="0" width="100%"></iframe></td>
<td width="85%" valign="top" align="left"><iframe src="***DYNAMIC CONTENT***" frameborder="0" width="100%"></iframe></td>
</tr>
<tr height="75">
<td width="15%">bottom content</td>
<td width="85%">bottom content</td>
</tr>
</table>
</body>
</html>
***DYNAMIC CONTENT*** may be replaced by another URL from the same domain as the main page or it may be a URL to a page in another domain.
Any help would be greatly appreciated.