Log in

View Full Version : Iframe help - refresh after load?



baitfish
06-09-2007, 04:01 AM
I have an iframe in my index page that loads other pages via tabs; on those pages are links to other pages & web sites that also load into the iframe. The problem I have is that some of the links are low on their respective page and when the new page loads you can't see the top of the new page without scrolling up.

Example: <a href="http://www.newpage.com/" >New Page</a></b></li>

What can I do to get the page to refresh or scroll to the top after the page loads?

djr33
06-09-2007, 04:05 AM
In your iframe, include in the body tag:
<body ... onLoad="javascript:window.scrollTo(0,0);">

baitfish
06-09-2007, 04:16 AM
Thanks, but I think my post wasn't exactly correct; the iframe loads the new page and scrolls to the top, but the index page doesn't scroll up and so the top of the iframe and hence the new page is not visible without scrolling the index page up. Make any sense?

Your help is greatly appreciated.