Jump to content

Prevent Parent From 'jumping' When Iframe Loads A Anchor


DarkxPunk
 Share

Recommended Posts

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

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

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...