autoscroll loop

Discussion in 'JavaScript' started by silentbody, Feb 18, 2009.

  1. #1
    Hi,

    I have the script for autoscroll.

    var t;
    function stopscroll()
    {
    clearTimeout(t);
    }
    function autoscroll()
    {
    var scrollingbox=document.getElementById('autoscrollingbox');
    var scrollposition=scrollingbox.scrollTop + 2;
    scrollingbox.scrollTop=scrollposition;
    t=setTimeout(autoscroll,30);
    }


    It scrolls me the page from top to bottom. How can I make it a loop that scrolls to bottom, then continues with the top of the page and so on?



    Regards,

    Bogdan
     
    silentbody, Feb 18, 2009 IP