Make webpage jump to top when link inside iframe is clicked
My website uses a very tall iframe to display catalog pages from an external website. I'm using iframes here to make it look like the external catalog pages are on my webpages.
The problem is that when a visitor goes to my page, scrolls down to view all the contents inside the iframe, and then clicks a link inside the bottom of the iframe to goto the next page, that next catalog page will load inside the iframe, but the visitor will still be looking at the bottom of the iframe on my website, and thus has to scroll up to the top of my website to see the top of the iframe's contents.
How can I make it so when someone clicks a link inside the iframe, that the page with the iframe automatically scrolls to the top appearing as if the whole website has refreshed?
I can't test this in any browser except Opera now but at least there it works so you might give it a try. Add the following after the iframe tags in your top frame:
then test the page in Firefox, see what the alert message is and remove the alert line. If it says something about security or denied access then you're probably out of luck.
MSDN claims that iframes support onreadystatechange, so that could maybe scroll the page up as soon as the page starts loading in IE. Good luck...
Bookmarks