In the html below I use a script for a vertical scroller. The links move the scroller up and down to the correct part of the text. Now I would like to change the scrolling to the horizontal direction, moving to the left or the right to the correct part. I would think I have to change scrollTop and scrollHeight into scrollLeft and scrollWidth, but cannot figure out how I should do that. If someone could help me with it I would be very grateful.
This is the script for the vertical scroller I have:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script language="JavaScript" type="text/javascript">
<!--
function move_up1(){
document.getElementById('layertext2').scrollTop=0;
}
var timer;
var speed=20;
function Scroll(lnk){
clearTimeout(timer);
p=document.getElementById('layertext2');
c=document.getElementById('layertext2').getElementsByTagName('a')[lnk];
if (c.offsetTop<p.scrollTop-speed){
p.scrollTop=p.scrollTop-speed;
timer=setTimeout('Scroll('+lnk+')',1);
}
else if (c.offsetTop>p.scrollTop+speed){
p.scrollTop=p.scrollTop+speed;
timer=setTimeout('Scroll('+lnk+')',1);
}