var speed=20 var m; function Marquee(n){ var marDiv = document.getElementById("t_"+n) var marNobr = document.getElementById("n_"+n) if(marNobr.offsetWidth-marDiv.scrollLeft<=0)marDiv.scrollLeft-=marNobr.offsetWidth marDiv.scrollLeft++ } function sT(n){ m=setInterval("Marquee('"+n+"')",speed) } function cT(o) { clearInterval(m); o.scrollLeft=0 } function iText(TextId,TextWidth){ for (var i=0;i<eval(TextId).length;i++){ var LayId=TextId+i; var DivId="t_"+TextId+i; var NobId="n_"+TextId+i; var marDiv = document.getElementById(DivId); var marNobr = document.getElementById(NobId); eval(TextId)[i].innerHTML = "<div id='"+DivId+"' style="\" mce_style="\""width: "+TextWidth+"px;overflow: hidden;\" onMouseover=sT('"+LayId+"') onMouseout=cT(this)><NOBR id=\"n_"+LayId+"\">"+ eval(TextId)[i].innerHTML +"</NOBR></div>"; } }
图片滚动js实现
最新推荐文章于 2024-06-29 15:18:41 发布