Autoscroll content up and down inside box?

Permalink
Hi,

I made my own theme and have created a box, where I plan to put in the daily news. But sometimes there are more news than what fits inside the box, so I'd like to have some sort of auto-scrolling-feature that scrolls the content of the box up and down.

How would I go about doing that? Pagination is not an option here :-)

BR,
Thomas

 
buntho replied on at Permalink Reply
In case anyone stumbles across this, I solved it using javascript. :) Can't remember where I found it, but it's a pretty straightforward script.

<script language="javascript">
   ScrollRate = 100;
   function scrollDiv_init() {
      DivElmnt = document.getElementById("blockStyle282Today69");
      ReachedMaxScroll = false;
      DivElmnt.scrollTop = 0;
      PreviousScrollTop  = 0;
      ScrollInterval = setInterval('scrollDiv()', ScrollRate);
   }
   function scrollDiv() {
      if (!ReachedMaxScroll) {
         DivElmnt.scrollTop = PreviousScrollTop;
         PreviousScrollTop++;
         ReachedMaxScroll = DivElmnt.scrollTop >= (DivElmnt.scrollHeight - DivElmnt.offsetHeight);
      }


Just change this line, so it contains whatever the ID of your block is.

"DivElmnt = document.getElementById("blockStyle282Today69");"