如何用一行jquer實現動畫輪播
<div class=“slide”>
<img src=“1.png”>
<img src=“2.png”>
<img src=“3.png”>
<img src=“4.png”>
</div>
也就是你運氣好,讓別的看見又得告訴你思路了
var speed=30 gpic2.innerHTML=gpic1.innerHTML function Marquee(){ if(gpic2.offsetWidth-gpic.scrollLeft<=0) gpic.scrollLeft-=gpic1.offsetWidth else{ gpic.scrollLeft++ } } var MyMar=setInterval(Marquee,speed) gpic.onmouseover=function() {clearInterval(MyMar)} gpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}