熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

ASP.NET中利用DataList實現圖片無縫滾動

2022-06-13   來源: .NET編程 

  <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>


From:http://tw.wingwit.com/Article/program/net/201311/14420.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.