Forum Moderators: open

Message Too Old, No Replies

link to an anchor on an iframe

         

floriauck

2:41 am on Aug 15, 2004 (gmt 0)

10+ Year Member



hello,

wow - this is a pretty specific and I think unique question. Well, at least for me it seems that way. I am more than sure that its easy and that somebody has the code for it, and here it goes.

I have a page with a build in i-frame! in the i-frame i load a different html page. So lets say the first page is called family.htm and the page in the iframe is called parents.htm. Ok, I set an anchor half down the parents.htm page (thats the page that loads in the i-frame) ok, now I want to make a link from lets say my homepage (index.html) that goes to the family.htm page BUT with also to the ANCHOR on the parents.htm? so that the family.html page opens BUT its set down at the anchor that i set on my parents.html page.. oh, wow I hope that makes sense? its so easy, but so hard to explain .. And also, can I do the same from my family.html page? make a link to the parents.html but so it loads in the iframe? and not in a new window or the same window.. you knwo what i am trying to say!

well, somebody knows the answer, i am sure,
thanks
florian

Span

8:07 am on Aug 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On your parents.htm, the page in the iframe, you make an anchor like so:
<a name="gohere"></a>
Then on family.htm you point your link to that anchor like this: <a href="parents.htm#gohere" target="name-of-iframe-here">

Your iframe needs a name <iframe src="" name=""> but you know that, yes?

If you want to go from a link on your parents.htm to an anchor on family.htm, point your link to <a href="family.htm#gothere" target="_top"> and make an anchor on family.htm <a name="gothere"></a>

Hope this helps. In case you're writing XHTML transitional add an id to the anchor tags like <a name="" id="" ... >

floriauck

12:55 pm on Aug 15, 2004 (gmt 0)

10+ Year Member



ohh.. this is how its done! i will go and try that right now, thanks for the great and fast help!

appreciate that,
florian