There are two main parts: one is the rolling content part; the other is the JS rolling code part. There are only two sentences.
I. Traditional rolling code
<Marquee scrollamount = "2" loop = "-1" scrolldelay = "0" width = "250"> use Javascript to horizontally scroll news content! </Marquee>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The traditional rolling code application has a relatively simple effect, and there are often browser compatibility problems. For example, the effect of marquee on FIREFOX will become invalid.
Ii. Rolling effect implemented by Javascript
Use Javascript to implement horizontal scrolling of news content. 1 // you can adjust the width and other parameters in the div label.
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The above is the complete JS rolling code. If you want to implement vertical scrolling, you only need to make a simple modification, that is, using the style's pixTop attribute.
From tianyuan blog