Automatically scroll through content cycle vertically

I am trying to find an easy way to have a div with only the text in it, automatically scrolling the text vertically. I do not want to use the framework (although I use Prototype, so if it is easier to use Prototype, then this is normal, but not Scriptalicious).

I suppose there is a way to do this with a few lines of code, but I'm not good enough in Javascript to find out how to do this most effectively.

0
source share
4 answers

It may not be normal, but you can try the tag <marquee>

it works in both IE and FF, and the last time I checked, safari too.

<marquee behavior="scroll" direction="up" height="250" 
   scrollamount="2" scrolldelay="10"">
  Your content goes here
</marquee>

, ,
<div>...
javascript...

,

onmouseover="this.stop()" onmouseout="this.start()"

IE

style="filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=0,
FinishOpacity=100, 
Style=1, StartX=0,  FinishX=0, StartY=0, FinishY=10) 
progid:DXImageTransform.Microsoft.Alpha( Opacity=100, FinishOpacity=0, 
Style=1, StartX=0, FinishX=0, StartY=90, FinishY=100)" 

...

+6
function scrollDivUp(id){
    document.getElementById(id).scrollTop-=1
    timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

- .

.scrollTop- = 1 .scrollTop + = 1, .

div, , .. style = "width: 200px; height: 300px; overflow: auto"

0

div scrollTop. .

0

I see that the correct answer has not yet been given. I think you need to look at cloneNode (), for example. And clone the item you want to scroll. When the first item is at the last scroll point, place the duplicated item after the first item. And when this duplicated item is almost at the end, place the original after the duplicate and so on!

0
source

All Articles