<div id="demo" style="overflow: hidden; width: px; border: px"> <table width="" height="" border="" cellpadding="" cellspacing="" background="Images/img/jpg"> <tr> <td align="center" id="demo" valign="bottom"> <asp:DataList ID="DataList" runat="server" RepeatDirection="Horizontal" DataSourceID="ObjectDataSource"> <ItemTemplate> <table> <tr> <td> <asp:ImageButton ID="imgbtnInfo" runat="server" ImageUrl=<%#Eval("Spic") %> OnClick="imgbtnInfo_Click"CommandArgument=<%#Eval("ID") %> /> </td> </tr> <tr> <td align="center"> <asp:LinkButton ID="lkbtnInfo" CommandArgument=<%#Eval("ID") %> runat="server" OnClick="lkbtnInfo_Click" CssClass="bb" Text=<%#Eval("Type") %>></asp:LinkButton> </td> </tr> </table> </ItemTemplate> </asp:DataList> <asp:ObjectDataSource ID="ObjectDataSource" runat="server" SelectMethod="SelectInfo" TypeName="HotelDALKeFangServices"></asp:ObjectDataSource> </td> <% 这一步很重要 %> <td id="demo" align="center" valign="bottom"> </td> </tr> </table> </div> <script> //滚动的速度数值越大速度越慢 var speed = demoinnerHTML = demoinnerHTML //从右至左 function Marquee() { if (demooffsetWidth demoscrollLeft <= ) demoscrollLeft = else demoscrollLeft++ } var MyMar = setInterval(Marquee speed) demoonmouseover = function () { clearInterval(MyMar) } demoonmouseout = function () { MyMar = setInterval(Marquee speed) } </script>