//你要滚动的内容</div>
<div id="drgc" style=" position:absolutewhite-space:nowrap">
</div>//下面是JS代码 document.getElementById("drgc").innerHTML = ""
document.getElementById("drgc").innerHTML = document.getElementById("dygc").innerHTML
while (document.getElementById("drgc").offsetWidth <document.getElementById("dygc").offsetWidth) {
document.getElementById("drgc").innerHTML += document.getElementById("drgc").innerHTML
}
document.getElementById("dygc").innerHTML = document.getElementById("drgc").innerHTML + document.getElementById("drgc").innerHTML
document.getElementById("drgc").style.display = "none"
setInterval("dee()", 50)
function dee(){
jll = document.getElementById("dygc").scrollLeft
document.getElementById("dygc").scrollLeft += 1
if (jll == document.getElementById("dygc").scrollLeft) {
document.getElementById("dygc").scrollLeft = document.getElementById("drgc").offsetWidth - document.getElementById("dygc").offsetWidth + 1
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)