I need to roll the code to make something and it is seamless. After working on it for a long time, it still doesn’t work.
I am determined to solve this problem. After research, it is not difficult. The code is as follows:
Program code
aaaaaaaaaaa
aaaaaaaaaaa a < p>aaaaaaaaaaa
aaaaaaaaaa 🎜 > | |
<script> <br>var speed=15 <br>demo2.innerHTML=demo1.innerHTML//Clone demo1 to demo2 <br>function Marquee(){ <br>if(demo2.offsetHeight-demo.scrollTop<=0)//When When scrolling to the junction of demo1 and demo2 <BR>demo.scrollTop-=demo1.offsetHeight//demo jumps to the top <br>else{ <br>demo.scrollTop //If it is horizontal, change all height top to width left <BR>} <BR>} <BR>var MyMar=setInterval(Marquee,speed)//Set the timer <BR>demo.onmouseover=function() {clearInterval(MyMar)}//Clear the timer when the mouse is moved up The device achieves the purpose of stopping scrolling <BR>demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//Reset the timer when the mouse is moved away <BR></script>
Copy it to an HTM file and run it.