Asp. NET for seamless scrolling of pictures with DataList

Source: Internet
Author: User

This problem before also troubled me, later solved, take out to share under, later use also convenient, code is easy to understand, not much to say what

[HTML]View Plaincopyprint?
  1. <div id="Demo" style="Overflow:hidden; width:441px; border:0px ">
  2. <table width="441" height=" border=" 0 " cellpadding=" 0 " cellspacing="0" background="images/img2/32.jpg">
  3. <tr>
  4.                  <td align= "center"  id= "Demo1"  valign= "bottom" >  
  5. <asp:datalist id="DataList1" runat="Server" repeatdirection="Horizontal " datasourceid="ObjectDataSource1">
  6. <ItemTemplate>
  7. <table>
  8. <tr>
  9. <TD>
  10.                                           <asp:imagebutton  id= "Imgbtninfo"  runat= "server"  imageurl= <%# Eval ("spic")  %> '  onclick= ' Imgbtninfo_click '   
  11. commandargument=' <% #Eval ("ID")%> ' />
  12. </td>
  13. </tr>
  14. <tr>
  15.                                       <td align= "center" >  
  16.                                           <asp:linkbutton  id= "Lkbtninfo"   Commandargument= <% #Eval ("ID")  %> '  runat = "server" &NBSP;&NBSP;
  17.                                               OnClick=" Lkbtninfo_click " cssclass=" BB "  text= ' <% #Eval ("Type")  %> ' ></asp:linkbutton>   
  18. </td>
  19. </tr>
  20. </Table>
  21. </ItemTemplate>
  22. </asp:datalist>
  23. <asp:objectdatasource id="ObjectDataSource1" runat= "server" selectmethod=" Selectinfo "
  24. typename="hoteldal.kefangservices"></asp:objectdatasource>
  25. </td>
  26. <%--This step is important--%>
  27. <TD Id="Demo2" align= "Center" valign="Bottom">
  28. </td>
  29. </tr>
  30. </Table>
  31. </div>
  32. <script>
  33. Scrolling speed, the higher the value, the slower the speed
  34. var speed =
  35. demo2.innerhtml = demo1.innerhtml
  36. From right to left
  37. function Marquee () {
  38. if (Demo1.offsetwidth-demo.scrollleft <= 0)
  39. Demo.scrollleft = 0
  40. Else
  41. demo.scrollleft++
  42. }
  43. var mymar = setinterval (Marquee, speed)
  44. Demo.onmouseover = function () {clearinterval (MyMar)}
  45. Demo.onmouseout = function () { MyMar = setinterval (Marquee, Speed)}
  46. </Script>

Asp. NET for seamless scrolling of pictures with DataList

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.