This article mainly introduces the sample code for js + div to implement the image scrolling effect. If you need it, you can refer to it for help.
Horizontal
Onmouseout = "doscroll ()">
Border = 0>
Border = 0>
Script
Var t = demo. scrollWidth
Demo1.innerHTML + = demo1.innerHTML
Function doMarquee ()
{
Demo. scrollLeft = demo. scrollLeft }
Function doscroll ()
{
SC = setInterval (doMarquee, 20)
}
Function stopscroll ()
{
ClearInterval (SC)
}
Doscroll ()
Script
Vertical
Border = 0>
Border = 0>
Script
Var speed = 100
Demo2.innerHTML = demo1.innerHTML
Function Marquees (){
If (demo2.offsetTop-demo. scrollTop <= 0)
Demo. scrollTop-= demo1.offsetHeight
Else {
Demo. scrollTop ++
}
}
Var MyMars = setInterval (Marquees, speed)
Demo. onmouseover = function () {clearInterval (MyMars )}
Demo. onmouseout = function () {MyMars = setInterval (Marquees, speed )}
Zlselect ('6 ');
Script