Forum Moderators: open

Message Too Old, No Replies

Need to have parent page scroll to top when iFrame changes

         

sifujc

5:51 pm on May 29, 2009 (gmt 0)

10+ Year Member



We deliver our company product via an iframe. Because of this the iframe height parameter is set for 1000px to accommodate long pages without having to have a constant scrollbar (which the CEO forbade).

Here's the problem. Our Registration page has you scroll down below the fold to complete it. When you click "Submit" at the bottom of the page, the page changes to a "Registration Complete" page, which is considerably shorter. Short enough, in fact, that in certain browser windows the customer is stuck staring at a blank page and wondering what happened... This happens a couple of other times in the product, as well... longer pages with "submit" buttons at the bottom and then we're stuck.

Rather than extending the aforementioned pages to the full 1000px height, I would prefer to have the parent page scroll up to its top when the iframe page changes. Keep in mind, these are partner parent pages that I don't have control over.

I tried using <body onLoad="window.parent.scroll(0,0); " /> on the "Registration Complete" page, but that didn't work. Any ideas?

Moderator Note - see this 2010 thread: Need to Have Parent Scroll to Top When iFrame Opens [webmasterworld.com]

[edited by: tedster at 11:24 pm (utc) on May 1, 2010]

swa66

5:58 pm on May 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

Any chance of reconsidering the iframe option ?

sifujc

6:11 pm on May 29, 2009 (gmt 0)

10+ Year Member



Thanks to the welcome. Unfortunately, no. The business model relies on delivering something simple to our partners.

swa66

7:07 pm on May 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah, something simple to partners ... having seen some partners that wanted me to add a large iframe: none of them ever got it working good enough for me to want to use it.

There are other options, e.g. adsense for search uses a couple of calls to a javascript on google's servers and presto: done.

The added benefit is that their javascript changes the html of the page itself, not of an iframe where they'd have a very hard time controlling anything around the iframe (if the browser would allow that it would be a huge security issue).

If you want to be a success I'd suggest to invest some time in that route (and some ajax of course).

tedster

8:35 pm on May 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might load a new parent page directly (including target="_top")and then have a different url in the iframe. I would keep these variants of the parent page as strcitly noindex.

sifujc

4:28 pm on Jun 1, 2009 (gmt 0)

10+ Year Member



Just to clarify, I have control of the app that we're delivering in an iframe (and that we're delivering it as an iframe won't change anytime soon), and the <iframe> code delivered to the partners. The partners are the ones controlling the parent page that hosts the iframe.