PDA

View Full Version : Iframes?



Black_Apalachi
11-11-2008, 01:55 PM
One last thing lol, I'm making too many threads :P.

Am I right in thinking that an Iframe is what's needed if you want each page to be the same except the content area?

If that's correct, does the Iframe for each page eg: News, Guides, etc. just have to contain the actual content for that specific page (i.e. text and formatting)?

If I'm going to use a scroll bar (only to appear when needed), should this be in the div or the Iframe (which would be inside the div anyway)? And finally, what would be the correct code to use one?

Thankies :D

Iszak
11-11-2008, 03:18 PM
The page the iframe links to has to be a webpage like on your normal site not just the styling - it's got to have proper mark-up, head, body, doctype etc. Secondly you don't have to use iframes but since it's an almost guarateed to work in all browsers unlike using AJAX requests which the user could have javascript disabled. Thirdly the scroll bar is a part of the iframe and in Internet Explorer displays by default. As for how to code one have a look at this page http://www.w3.org/TR/REC-html40/present/frames.html.

Black_Apalachi
12-11-2008, 02:57 AM
The page the iframe links to has to be a webpage like on your normal site not just the styling - it's got to have proper mark-up, head, body, doctype etc. Secondly you don't have to use iframes but since it's an almost guarateed to work in all browsers unlike using AJAX requests which the user could have javascript disabled. Thirdly the scroll bar is a part of the iframe and in Internet Explorer displays by default. As for how to code one have a look at this page http://www.w3.org/TR/REC-html40/present/frames.html.

Oh of course yeah :P. Thanks :).

Black_Apalachi
12-11-2008, 04:30 AM
I can't get my head round how to do this (don't worry I'm not making yet another thread :P).

You've probably seen my layout (link in sig), from left to right it has the banner, then the navigation, then a content box anf then there are two other boxes underneath these. I have an iframe in the main right-hand content box.

Ok, how I'm imagining the site to work is that when a navigation link is clicked (e.g. "News"), instead of opening a whole new page, it just opens the news content page in the iframe. Therefore the rest of the page (i.e. the two bottom boxes and the overall layout, banner etc) remains the same for every navigation link.

Is this how an iframe works and am I thinking about it the right way?

So I think what I'm trying to ask is, how do you make a navigation link open a content document in the iframe?

Trinity
12-11-2008, 07:53 AM
I can't get my head round how to do this (don't worry I'm not making yet another thread :P).

You've probably seen my layout (link in sig), from left to right it has the banner, then the navigation, then a content box anf then there are two other boxes underneath these. I have an iframe in the main right-hand content box.

Ok, how I'm imagining the site to work is that when a navigation link is clicked (e.g. "News"), instead of opening a whole new page, it just opens the news content page in the iframe. Therefore the rest of the page (i.e. the two bottom boxes and the overall layout, banner etc) remains the same for every navigation link.

Is this how an iframe works and am I thinking about it the right way?

So I think what I'm trying to ask is, how do you make a navigation link open a content document in the iframe?


<a href="URL" target="IFRAMENAME">link</a>

Black_Apalachi
12-11-2008, 05:37 PM
<a href="URL" target="IFRAMENAME">link</a>

Thanks. I have kind of made it work using that, but I'm still unsure on something. I imagine this code is probably wrong but the "nav 1" div is where the link will be and iframe in the "main_middle" div is where the content will show (once the link is clicked).


<div id="nav_1">
<a href="/hello.html" target="hello">link</a>
</div>
<div id="main_middle">
<IFRAME NAME="hello" SRC="hello.html" WIDTH=480 HEIGHT=350 FRAMEBORDER=0 MARGINWIDTH=auto MARGINHEIGHT=auto></IFRAME>
</div>...But if there are several links, would I put all their targets in the "main_middle" div (in seprate iframes or not)? I don't get how doing that wouldn't make all the content pages show at the same time though :(.

Want to hide these adverts? Register an account for free!