Help - Search - Members - Calendar
Full Version: iFrame alternatives
Pixel2Life Forum > Help Section > HTML, XHTML, CSS and General Web Design
Darren Taylor
When I used to design sites (mostly for personal use), I used iFrames. The reason for doing so was:
  • avoid loading nav menus every time a knew page was opened
  • easily updating the index page without having to change it on every page
  • having content appear in the same place
Nowadays, i know iFrames are pretty much frowned upon, so I was wondering if there was any other way to deal with the 3 points above.

Thanks in advance
Darren Taylor
derek.sullivan
You can use css to replace iFrames.. such as

CODE
#tag
{
border: #000 1px solid;
width: 400px;
height: 50px;
overflow: auto; // will make all the content scroll... will not overflow the border of this div tag
padding: 2px;
}

<div id="tag">
SCROLL
SCROLL
SCROLL
SCROLL
SCROLL
etc etc
</div>


And you can use JS/AJAX to automatically update the box without having to reload the page etc etc etc.. Hopefully that helped.
Darren Taylor
I don't really understand how CSS can help.

This is the layout I am trying to code:
http://img261.imageshack.us/img261/6859/concept23qz3.jpg

As you can see, I'd normally shove an iframe in the middle and have all the links load up in there, but I'd rather slice it and code it so that the layout will extend as more content is put in.

I've tried with tables, but it doesn't work out ideally as I can't set 3 tables aside each other (one for images, one for content, and other for fesch).

Does anyone have any more input or can point me in the direction?

Mr. Matt
My alternate to frames is by using php. You create the main template then use a php switch to switch the content that goes in the content box.

Then you can use css and divs to code the layout which is the most accepted way.

Hope this points you in the right direction.
Jacorre
I agree with Mr. Matt. You can section your pages up such as having one file for the header, one for the footer, one for the sidebar, etc. That way you only need to update one file which would then apply across all pages of your site.
Evans Davis
have used IFRAME in certain cases where the code is on another server.
This
seems to work well. There are certain differences;
1. IFRAME WILL pay attention to any header CSS or JS code, where FP INCLUDE
doesnt
2. IFRAME seems to be a bit more picky about definition of width and length
than FP INCLUDE
3. IFRAME has NEVER doubled up on me.
4. Page counters via CGI do not get incremented on IFRAME documents as
reliably as when FP INCLUDE is used. I dont know why.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.