Copy code The code is as follows:<html> <head> <style type="text/css"> <!-- #demo { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #98CBFF; margin-bottom: 10px; margin-left: 5px; overflow: hidden; padding: 0 0 5px; width: 948px; } #demo img { border: 3px solid #F2F2F2; } #indemo { float: left; width: 800%; } #demo1 { float: left; } #demo2 { float: left; } .box { border: 1px solid #98CBFF; float: left; margin: 7px 10px; overflow: hidden; padding: 5px; width: 150px; } --> </style> </head> <body> Image scrolls left seamlessly Scrolls left Copy code The code is as follows:<div id="demo"> <div id="indemo"> <div id="demo1"> <div class="box"> <a href="#"><img src="upload/2022/web/Clear_logo.gif" border="0" /></a> <p>Your number</p> hello </div> <div class="box"> <a href="#"><img src="upload/2022/web/Clear_logo.gif" border="0" /></a> <p>idiot</p> stupid </div> <div class="box"> <a href="#"><img src="upload/2022/web/Clear_logo.gif" border="0" /></a> </div> </div> <div id="demo2"></div> </div> </div> <script> <!-- var speed=10; //The larger the number, the slower the speed var tab = document.getElementById("demo"); var tab1=document.getElementById("demo1"); var tab2 = document.getElementById("demo2"); tab2.innerHTML=tab1.innerHTML; function Marquee(){ if(tab2.offsetWidth-tab.scrollLeft<=0) tab.scrollLeft -=tab1.offsetWidth else{ tab.scrollLeft++; } } var MyMar=setInterval(Marquee,speed); tab.onmouseover=function() {clearInterval(MyMar)}; tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)}; --> </script> </body> </html> |
<<: MySQL extracts Json internal fields and dumps them as numbers
>>: Linux swap partition (detailed explanation)
It's the end of the year and there are fewer ...
First, let's introduce a few key points about...
Recently, a friend asked me a question: When layo...
When designing H5 layout, you will usually encoun...
First, let’s understand what MySQL is? MySQL is a...
Big pit, don't easily delete the version of P...
Table of contents Styles in uni-app Summarize Sty...
Preface This article contains 1. Several major co...
1. Create the tomcat installation path mkdir /usr...
Preface I once encountered a difficult problem. I...
Table of contents Overview Defining filters Use o...
1. Always use :key in v-for Using the key attribu...
Table of contents 1. What is Promise 2. Basic usa...
The width of the parent container is fixed. In or...
Make an animation of the eight planets in the sol...