Replacement for Iframe?

liunx

Guest
Well, I really liked the iframes for my first page design (<!-- w --><a class="postlink" href="http://www.dikaios.net/lowband">www.dikaios.net/lowband</a><!-- w -->). It's a fixed height. Now I want to change that to something a little different. I really don't want people to have to reload the whole page everytime they click on a new link. I have done some searches here, and I see that the iframe cannot have a dynamic height that adjusts to it's CONTENT. It will only adjust to it's parent page. What can I replace it with? Any thoughts?<!--content-->You know, there isn't that much information that's below the iFrame. Could you just make the frame itself a bit bigger? There appears to be plenty of space.<br />
<br />
I think the only reason the page refreshes is because you're changing the left side content. I know there's a j/s for changing two frames at once, but I'm not sure that it would work for an iFrame. You could have the "new" navigation as an iFrame, rather than as simple text and each link that goes to a different page would change the 'nav' iFrame as well as the 'main' one.<br />
<br />
I'll have to look it up and see.<br />
<br />
Peg<!--content-->The site that I gave is working fine as it is. That's the fixed height site. The thing is, the content is growing, and I need to update the site. When I do this, the pages are going to get longer. And, there is no real way to tell HOW long they are going to be in the near future. What I want to do is update the individual pages (ie the calendar page), and not have to worry about having to go back to the index page, and adjust the iframe size. Not to mention, I'd like to add text-only links at the bottom of the page to mirror the other links at the top of the page. If I do this, and the iframe is set to a height of say 750 to accomodate the biggest page, but the current page in the iframe is only 300 high, the text links are now 450px below the "bottom" of the page content. I'm looking for something that will act as a table cell, adjusting it's height to accomodate the content. Larger AND smaller as is needed. Maybe what I need to do is use js to change the innerHTML of a table cell? If so, can this be done by telling it to put the contents of file X into the cell? Is this the best way to do it?<br />
<br />
Anyway, as you can tell, I have no idea what to do.<!--content-->SSI is the only way I can think of to cut down on the upgrading time. You could have the page cut off before the iFrame and make individual changes to the iFrame size as necessary.<br />
<br />
Entimp has a couple of tutorials to get you started.<br />
<br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=25590">http://www.htmlforums.com/showthread.ph ... adid=25590</a><!-- m --><br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=25616">http://www.htmlforums.com/showthread.ph ... adid=25616</a><!-- m --><br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=25644">http://www.htmlforums.com/showthread.ph ... adid=25644</a><!-- m --><br />
<br />
Peg<!--content-->whats wrong with the page reloading? :P<br />
<br />
it is possible to dynamically resize the iframe using a bit of javascript. what you do is, in the iframe document put everything inside of a div, give it an id of something like 'mainContent' and dont give the body any margins, if you do you can add onto the total height in the javascript. then in the main page give the frame an id of like 'mainFrame'. then in the iframe document put this in the head.<br />
<br />
<script type="text/javascript"><br />
window.onload = function() {<br />
totalHeight = document.getElementById('mainContent').offsetHeight;<br />
parent.document.getElementById('mainFrame').height = totalHeight;<br />
}<br />
</script><br />
<br />
if you define the height of the iframe with css then you would do parent.document.getElementById('mainFrame').style.height = totalHeight + "px";<br />
<br />
that should work, but i would suggest just having the page reload<!--content-->that is the whole purpose of an iframe, to scroll so the page doesn't get bigger. if you kept the iframe at such a small scale to where it doesn't scroll them what is the purpose of having a iframe at all. your next solution is just a plain framed site, which you might not like.<br />
<br />
either way if you use SSI or an iframe the page will still scroll.<!--content-->its not an issue of scrolling, its that he doesnt want the whole page to have to reload, but he wants the iframe to expand to its content instead of having a static area<!--content-->then it has to do with scrolling if you want it to expand to it contents. that means he doesn't want the same size for a big page that way it won't sroll.<!--content-->Yes guys...it DOES have to do with scrolling, AND with not having the page load. I didn't want to have to reload the page, but I also didn't want scroll bars. No big deal though...I'm just going to re-work it, and have the page reload. Thanks though.<!--content-->
 
Back
Top