< form id ="Form1" method ="post" runat ="server" > < TABLE cellSpacing ="0" cellPadding ="0" width ="464" align ="center" border ="0" style ="Z-INDEX: 101; LEFT: 88px; POSITION: absolute; TOP: 64px" > < TR > < TD > < DIV id ="demo" style ="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff" > < TABLE cellSpacing ="0" cellPadding ="0" align ="left" border ="0" cellspace ="0" > < TBODY > < TR > < TD id ="demo1" vAlign ="top" > < asp:DataList id ="DataList1" runat ="server" RepeatDirection ="Horizontal" Width ="464px" > < ItemTemplate > < div align ="center" > <% ... # DataBinder.Eval(Container.DataItem,"uname") %> </ div > </ ItemTemplate > </ asp:DataList > </ TD > < TD id ="demo2" vAlign ="top" > </ TD > </ TR > </ TBODY > </ TABLE > </ DIV > < SCRIPT > ... var speed3=25//速度数值越大速度越慢 demo2.innerHTML=demo1.innerHTML function Marquee()...{ if(demo2.offsetWidth-demo.scrollLeft<=0) demo.scrollLeft-=demo1.offsetWidth else...{ demo.scrollLeft++ } } var MyMar=setInterval(Marquee,speed3) demo.onmouseover=function() ...{clearInterval(MyMar)} demo.onmouseout=function() ...{MyMar=setInterval(Marquee,speed3)} </ SCRIPT > </ TD > </ TR > </ TABLE > </ TD ></ TR ></ TABLE > </ form > 后台绑定 DataList