Welcome to WebmasterWorld Guest from 54.205.74.11

Forum Moderators: incrediBILL

iframe anchor linking?

linking to anchor within iframe

   
2:41 pm on Jan 18, 2012 (gmt 0)



Hello all! My 1st post.

I have an iframe embedded on my webpage of a .html manual and I would like to be able to have the manual open to certain anchors within it when a given page on my website is visited.

Here is the iframe code I have that will open up the manual but then the visitor has to scroll to the topic covered:

<iframe name="FRAME1" src="../r6manual/TTM Mixer.14.05.html" width="1100" height="600" frameborder="0" ></iframe>


Here is the anchor code on the TTM Mixer.14.05.html that I would like to be showing when the page is visited.

<div class="Subhead"><a name="468813">Dynamics section</a></div>


Thank you so much for your time,
Matt.
7:03 pm on Jan 18, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to the forums, MediaSVI. I think you need to include a page fragment identifier in the iframe's src URL

<iframe name="FRAME1" src="../r6manual/TTM Mixer.14.05.html#468813" width="1100" height="600" frameborder="0" >

And more than that, I'd suggest using the id attribute, not the name attribute, on the actual embedded page:

<div class="Subhead"><a id="468813">Dynamics section</a></div>
7:46 pm on Jan 18, 2012 (gmt 0)



Thanks! It works just fine without changing the name attribute and to change it would be a huge task as this is a manual that I am just embedding into my website so it works just like it would on your desktop.

One thing though is that when I goto the web page the page loads and jumps to the anchor point which is down on the webpage, I would like the page to load and stay at the top how would I do this?

Thank you for your time,
Matt.
8:41 pm on Jan 18, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



That's the way it works, the browser needs to load the earlier content first. Sometimes the effect is not noticeable but on a slow connection or a very big page it can be very noticeable. If the iframed page is extremely long, maybe you can break it up into sub pages.
9:05 pm on Jan 18, 2012 (gmt 0)



Is there code to load the main page 1st and then load the iframe page?
11:33 pm on Jan 18, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I don't think it's worthwhile to try to control that. In my experience, that kind of attempt at control usually ends badly and eats up a lot of time.

Theoretically, it could be possible with JavaScript, I guess... by not even writing the iframe code into the page until the main page is loaded. But that approach is likely to create more usability issues than it resolves, especially cross-device and cross-browser.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month