[Javascript] Scrolling Frames

Peter-Paul Koch gassinaumasis at hotmail.com
Wed Jul 25 14:39:21 CDT 2001



>Hello all,
>      I'm betting the answer to my question is no, but I thought I'd ask
>anyway.
>
>Is there a way to "synchronize" scrolling for multiple frames?

Yes, that should be possible, though it won't be easy to write. Basically 
you need to track where the user is in one frame. This is done by

function keepTrack()
{
if (window.innerHeight)
{
  pos = window.pageYOffset
}
else if (document.body)
{
  pos = document.body.scrollTop
}
setTimeout('keepTrack()',100)
}

Now pos contains the coordinate of the 'scrolling position' in one frame. 
Then you'll need to tweak the value of pos and use scrollTo() to scroll the 
second frame.

I don't think this is easy, but it can be done.

ppk


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




More information about the Javascript mailing list