views:

19

answers:

1

Hello,

When someone clicks on a link within an iframe (child page), how do I get the parent page to scroll to the top? The issue is the child page will remain in the same spot of the page, because the iframe has a lot of height larger than the parent page.

Please note: the parent and child pages are on different sub domains.

I created a demo to show this: http://www.apus.edu/_test/iframe/index.htm

A: 

the trick is to append onload="window.parent.parent.scrollTo(0,0)" to the iframe and that will do it!

Evan