Forum Moderators: open

Message Too Old, No Replies

Setting links to open in an IFRAME

         

gabbybelle

6:20 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



I'm so confused right now and would appreciate help. I'm setting up my website w/iframes, and on the home page I have the iframe set up and working. The part i'm confused about is....how do i get it so when you click on a link it pulls it up in that frame? Does that make sense?

I know each iframe is supposed to have a name of its own, but for example...I want a page titled "about" to be clicked on and bring the frame up. So what code am i going to put on the index page to bring it up and will i be putting a different iframe code on the "about" page as well to get it to work?

the link originally to just take it to the next page is:
<a href="about.html">about</a>

so what do i need to do differently to get it to work as an iframe? Pleeeze help!

Thanks in advance!
Gabby

Bonusbana

6:28 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



Hi

Give your iframe a name, just add id="whatever" and name="whatever" in the iframe tag. Then on your mainpage use:

<a href="about.html" target="whatever">about</a>

This will display the about.html in the iframe.

You must use both id and name to be cross-browser compatible.

gabbybelle

6:53 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



hi,

thanks so much...please forgive me if i sound stupid though. I'm just going to clarify here to make sure I understand.....

"Give your iframe a name, just add id="whatever" and name="whatever" in the iframe tag."

is this what the code would look like then?
<IFRAME name="myframe" id="myframe" src="about.html"></IFRAME>
the id and name will be the same for each frame?
and this code will go on the page "about" and I will put this above the about content? is that correct?

"Then on your mainpage use:
<a href="about.html" target="whatever">about</a>"

so for each link on the main page this is what the link will be...I think I got that down. It's the part above I wanted to make sure of.

Thanks!
Gabby

Bonusbana

8:56 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



On the index page you should put:

<iframe name="myframe" id="myframe" src="about.html"></iframe>

This will diplay the document "about.html" in the iframe. Now, if you want a link on your index page to switch so that your iframe displays another document f.e "info.html", do this:

<a href="info.html" target="myframe">link</a>

...on your index page.

I hope this clearifys things.

gabbybelle

9:17 pm on Mar 13, 2004 (gmt 0)

10+ Year Member



Yes, that is great! I got it working :) Thanks so much!