Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scrolling top frame in sync with bottom frame

Status
Not open for further replies.

SKTodd

Programmer
Mar 11, 2002
33
0
0
US
My user wants the heading to remain at the top of a document while scrolling thru the document. I put the heading in the top frame and the body of the document in the lower frame. I need the top frame to scroll to the right when the lower frame is scrolled. Why doesn't this script work?

<HTML>
<HEAD>
<SCRIPT language=&quot;JavaScript&quot;>
function initScrollSynchronization() {
setInterval(&quot;syncFrame()&quot;,1000);
}
function syncFrame(){
var scrollTop = chart.pageYOffset;
var scrollLeft = chart.pageXOffset;
heading.scrollTo(scrollLeft, scrollTop);
}
</SCRIPT>
</HEAD>

<FRAMESET ROWS=&quot;40%, *&quot; ONLOAD=&quot;initScrollSynchronization()&quot;>
<FRAME NAME=&quot;heading&quot;
SRC=&quot;heading.doc&quot;
SCROLLING=&quot;no&quot; noresize
frameborder=0>
<FRAME NAME=&quot;chart&quot;
SRC=&quot;chart.doc&quot;
SCROLLING=&quot;auto&quot; noresize
frameborder=0>

<NOFRAMES>
</NOFRAMES>

</FRAMESET>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top