Why can't the picture flow and display after I copy the two pieces of code at the same time on the homepage?
<SCRIPT> <br>var speed=25 <br>demo2.innerHTML=demo1.innerHTML <br>function Marquee1(){ <br>if(demo2.offsetWidth-demo.scrollLeft<=0) <BR>demo.scrollLeft-=demo1 .offsetWidth <BR>else{ <BR>demo.scrollLeft <BR>} <BR>} <BR>var MyMar=setInterval(Marquee1,speed) <BR>demo.onmouseover=function() {clearInterval(MyMar)} <BR>demo.onmouseout=function() {MyMar=setInterval(Marquee1,speed)} <BR></SCRIPT> Since these two pieces of code are exactly the same, a conflict occurs. Simply modify the code of another piece of code. The areas marked in red need to be modified. You try:
Copy the code The code is as follows:
<script> <br>var speed=25 <br>gundong2.innerHTML=gundong1.innerHTML <br>gundong.scrollLeft=gundong.scrollWidth <br>function Marquee1(){ <br>if(gundong.scrollLeft<=0) <BR>gundong.scrollLeft =gundong2.offsetWidth <BR>else{ <BR>gundong.scrollLeft- - <BR>} <BR>} <BR>var MyMar1=setInterval(Marquee1, speed) <BR>gundong.onmouseover=function() {clearInterval(MyMar1)} <BR>gundong.onmouseout=function() {MyMar1= setInterval(Marquee1, speed)} <BR></script>
Related labels:
Previous article:JS limits uploaded image size locally without using controls_Basic knowledge
Next article:Restrictions before JS uploads images include (jpg jpg gif and size, height and width), etc. _javascript skills
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Team collaboration - What should I do if someone needs the feature I wrote as a dependency in git flow?
From 1970-01-01 08:00:00
0
0
0
Confusion about using gitlab's fork&pull request mode within the team
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|