Mark <ms******@aol.c om> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
How do I scroll two textareas in sync with FireFox/Mozilla? The IE
solution has been posted before by Martin Honnen.
If this type of event isn't available, you can use simulate it using
periodic monitoring. The following example demonstrates the principle and
works in I.E. and Mozilla but not Opera. Under I.E. it works more smoothly
if the function is called also by the onscroll event:
<textarea id='ta1'onscrol l="scrollTa() ) ...... >
and you can experiment with shorter timeout the delays.
You don't say whether you want master/slave or dual master scrolling,
however if you want master/slave, remove the redundant code.
<script type='text/javascript'>
var ref1=document.g etElementById(' ta1'),
ref2=document.g etElementById(' ta2');
var vPos1=ref1.scro llTop,vPos2=ref 2.scrollTop;
function scrollTa()
{
if(ref1.scrollT op!=vPos1)
vPos1=ref2.scro llTop=ref1.scro llTop;
else
if(ref2.scrollT op!=vPos2)
vPos2=ref1.scro llTop=ref2.scro llTop;
setTimeout('scr ollTa()',250)
}
window.onload=s crollTa;
</script>
--
S.C.
http://makeashorterlink.com/?H3E82245A