Rob's TIMSS Blog

My discoveries and ramblings of TIMSS/Personify.

Monday, July 31, 2006

TCMS: IFRAME not scrolling to top

We are using TCMS in an IFRAME on our website. This way TCMS is a separate site but looks like it's still a part of our main website.

One issue we had was that when visitors navigated within the TCMS IFRAME, the IFRAME was not scrolling to the top of the next page. For example, when checking out, the Place My Order button is down far on the page, especially if there are several items in the cart. When the button is clicked, then order goes through and an invoice is displayed, however the IFRAME did not scroll to the top so the user might see a blank page, unless they scrolled up.

I found the following solution on the web (http://www.webmasterworld.com/forum21/10675.htm) and it worked like a charm. On the page calling the IFRAME add the following function:

<script language="javascript">
function scrollTotop()
{scroll(0,0);}
</script>

Then where the IFRAME is called add

<IFRAME name="iframe" onload="scrollTotop()" ... etc>

This way every time the IFRAME loads a page, it scrolls to the top.

Applies to: TIMSS6

0 Comments:

Post a Comment

<< Home