 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Caldar
Joined: 20 Feb 2005 Posts: 3
|
Posted: Sun Feb 20, 2005 10:29 pm Linking to anchor tags within an iframe |
|
|
|
I have a list of links on a web page containing an iframe. These links are meant to target specific anchor tags within the HTML document that is loaded into the iframe. The effect I am after is similar to the anchor tag links you often find an an FAQ page, where clicking on the question makes the document jump down to the answer. I am trying to do the same thing, but have the iframe text jump to the appropriate anchor tag (see code sample below). Unfortunately, the links do not seem to be working as I expected them to. Any suggestions?
Code snippets from parent page:
| Code: |
<IFRAME NAME="iText" WIDTH="500" HEIGHT="350" SRC="answers_txt.html" FRAMEBORDER="0"></IFRAME>
<A HREF="answers_txt.html#answer1" TARGET="iText">Question One</A><BR>
<A HREF="answers_txt.html#answer2" TARGET="iText">Question Two</A><BR>
<A HREF="answers_txt.html#answer3" TARGET="iText">Question Three</A> |
Anchor tag example from "answers_txt.hml" document:
| Code: |
| <A NAME="answer1"></A> |
This method works in non-iframe instances, but I can not get it to work in iframes. Is it possible, am I missing something, or am I out of luck because it is not implemented?
Thanks in advance for the help.
- Caldar |
|
chrisxkelley
Joined: 07 Dec 2004 Posts: 246
|
Posted: Mon Feb 21, 2005 2:46 am |
|
|
|
you could try just the anchor name in the url
| Code: |
<A HREF="#answer1" TARGET="iText">Question One</A><BR>
<A HREF="#answer2" TARGET="iText">Question Two</A><BR>
<A HREF="#answer3" TARGET="iText">Question Three</A>
|
seems to me that it should work, but maybe iframes dont like that. what browser are you testing it on? |
|
Caldar
Joined: 20 Feb 2005 Posts: 3
|
Posted: Mon Feb 21, 2005 8:49 am |
|
|
|
My mistake. The original method does work, I mistakenly was targeting a copy of the document that did not have the anchor tags. I knew that I put them in, but it was in a different copy of the document. Doh! Too many late nights.
Thanks for the help! |
|
chrisxkelley
Joined: 07 Dec 2004 Posts: 246
|
Posted: Mon Feb 21, 2005 11:04 pm |
|
|
|
| Quote: |
| Doh! Too many late nights. |
ha. i'm with you there on that.
glad you solved it
cheers,
chris |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|