DarkxPunk Posted January 13, 2012 Share Posted January 13, 2012 Hey everyone, From what I can gather from my searches this can only be solved by JavaScript. So here is the page: http://www.beta.zeitgeist-toronto.com/faq.php Now as you will see as of (Jan 12th 2012) when you load the page it jumps down to the iFrame anchor. Can I prevent it from jumping or have it jump back to the top of the parent page? Thanks for any help!Michael Link to comment Share on other sites More sharing options...
Don E Posted January 13, 2012 Share Posted January 13, 2012 In the iframe's src attribute, try removing #template: http://www.thezeitgeistmovement.com/faq#template Link to comment Share on other sites More sharing options...
Ingolme Posted January 13, 2012 Share Posted January 13, 2012 If you remove #template from the URL that the iframe is loading it won't jump to anywhere. Link to comment Share on other sites More sharing options...
DarkxPunk Posted January 15, 2012 Author Share Posted January 15, 2012 Yes this is quite obvious by my question was "Prevent Parent From 'jumping' When Iframe Loads A Anchor" note: When iFrame Loads a Anchor the #template being that anchor. The whole goal is that when it loads the iframe and jumps the content of the iframe to that section of the page, the actually parent stays at the top, or at least jumps back to the top. Link to comment Share on other sites More sharing options...
Ingolme Posted January 16, 2012 Share Posted January 16, 2012 I don't see the parent window doing anything. Which browser are you seeing this problem in? Link to comment Share on other sites More sharing options...
DarkxPunk Posted January 16, 2012 Author Share Posted January 16, 2012 Safari and IE9, I tested it in FF and noticed it does not move the parent and, but I did not test it in chrome. So I guess this is a Safari, IE9 problem, any suggestions for a fix? Link to comment Share on other sites More sharing options...
Ingolme Posted January 16, 2012 Share Posted January 16, 2012 I don't know if you've noticed, but in Firefox your iframe is very tiny. This problem looks like a result of how the browser handles links. I don't think it can be solved. Link to comment Share on other sites More sharing options...
DarkxPunk Posted January 17, 2012 Author Share Posted January 17, 2012 How about this. I am not good with JavaScript so if someone could make it up or assist me. Is it possible to make a script where after the iFrame loads the focus of the page is redirected to the top. That will stop the problem in ie and safari and not hinder ff or chrome. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 18, 2012 Share Posted January 18, 2012 Have you tried setting the pageWrap container to the height of the iframe. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 18, 2012 Share Posted January 18, 2012 this seems to fix IE but not Safari, give iframe id ref myframe window.onload=function(){var F = document.getElementById("myframe");var Fcontent = F.contentDocument || F.contentWindow.document;Fcontent.location.href= Fcontent.location.href+"#template";window.scrollTo(0,0);} Link to comment Share on other sites More sharing options...
DarkxPunk Posted January 18, 2012 Author Share Posted January 18, 2012 How about something that leaves the iframe alone but upon finishing the iframe simply scrolls the parent to 0,0 ? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 18, 2012 Share Posted January 18, 2012 OK! something strange is happening here, revert back to original code IF changed, and remove everything except window.scrollTo(0,0); window.onload=function(){window.scrollTo(0,0);} Seems to work fine with just this now! in all browsers, where as before, i had to wait until frame and page loaded, before moving frame content and scrolling to top. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.