RE: Frames Question

by Francois de Beer <fbeer(at)sars.gov.za>

 Date:  Tue, 25 Jan 2000 08:33:22 +0200
 To:  hwg-techniques(at)hwg.org
  todo: View Thread, Original
<<Snippety>>
Sometimes the content forces a scrollbar on the right frame and my boss
would like to know if there is anyway to have both frames scroll "in sync".
<</Snippety>>

ok. Here is your code (written very quickly but it SHOULD work....:
Frames Page Sample (Just note the name of the contents page = "contents" :

<html>
<head>
<title>My Frames Page</title>
</head>
<frameset cols="150,*">
  <frame name="contents" target="main" src="Content">
  <frame name="main" src="main">
  <noframes>
  <body>
  <p>This page uses frames, but your browser doesn't support them.</p>
  </body>
  </noframes>
</frameset>
</html>


Main Page (the one that the user uses to scroll):

<SCRIPT LANGUAGE=javascript>
<!--
function window_onscroll() {
window.parent.frames("contents").scrollTo(0,document.body.scrollTop)
}
//-->
</SCRIPT>

<BODY LANGUAGE=javascript onscroll="return window_onscroll()">
<p>bla bla</p>
</BODY>

HTH or at lease put you on the right track...
Cheerz
Beer

HWG hwg-techniques mailing list archives, maintained by Web Professional Association - IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.