Forum Moderators: open

Message Too Old, No Replies

Anchors in an iFrame

iFrame

         

cbessire

6:30 pm on Aug 22, 2005 (gmt 0)

10+ Year Member



I have one html page that has the iframe on it and the content is pulled in from a second html page (this may or may not matter).

Currently if I use an anchore it goes to the anchor spot but I loose the upper part of my page and there is only the iframe left. I want the anchors to work as they would in a normal html page.

I tried some code that was on a previous thread but it did not fix my problem.

Any advice would be great.

tedster

8:35 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, cbessire.

What does the current html for your named anchors and links look like? If there are domain names in the code, just change them to "example.com".

JAB Creations

9:01 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Outside the iframe...
<a href="youriframe.html#yourbookmark">text/img here</a>

In the iframe...

<a name="yourbookmark">yourbookmark</a>

cbessire

10:54 pm on Aug 22, 2005 (gmt 0)

10+ Year Member



Thank you so much for the quick reply. I'm not sure I understand the solutions. You can see an example of what I'm talking about at:

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

Once you click on the first link it will take you to the anchor but the top of the page disappears and I'm left with only the iframe.

faqs.htm contains the iframe code and faqs2.htm holds all the content and anchors for the page(hope this helps).

[edited by: tedster at 11:02 pm (utc) on Aug. 22, 2005]

tedster

11:13 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where are the links?

A. If they are in faqs.htm, then make sure there is an target="iframename" attribute in each <a href> tag

B. If they are in faq2.htm, they naturally will scroll off screen in order to scroll to the named anchor position. So, at least two ways to approach it:

1. Make sure there's a "top" link next to every answer, so users can click back to the list of links.
...or
2. Move the links into the main (parent) page and procede with target attributes in the tags, as in A above

cbessire

12:47 am on Aug 23, 2005 (gmt 0)

10+ Year Member



Thank you for the help. I got it to work a little differently.

The links are on faqs2.htm therefore, I put a top link/anchor to faqs.htm#top after every answer with the target=parent. Place the anchor next to the top menu on faqs.htm and it's pops me backup to where I need to be to see the full page again.

Thanks again for the advice...it helped.