Asp. NET in the use of DataList to achieve picture seamless scrolling instance sharing _ Practical skills

Source: Internet
Author: User
[HTML]
Copy Code code as follows:

<div id= "Demo" style= "Overflow:hidden; width:441px; border:0px ">
<table width= "441" height= "130" border= "0" cellpadding= "0" cellspacing= "0" background= "images/img2/32.jpg" >
<tr>
&LT;TD align= "center" id= "Demo1" valign= "Bottom" >
<asp:datalist id= "DataList1" runat= "server" repeatdirection= "horizontal" datasourceid= "ObjectDataSource1" >
<ItemTemplate>
<table>
<tr>
<td>
<asp:imagebutton id= "Imgbtninfo" runat= "server" Imageurl= ' <% #Eval ("spic")%> ' onclick= ' Imgbtninfo_click '
Commandargument= ' <% #Eval ("ID")%> '/>
</td>
</tr>
<tr>
&LT;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= "ObjectDataSource1" runat= "Server" selectmethod= "Selectinfo"
Typename= "Hoteldal.kefangservices" ></asp:ObjectDataSource>
</td>
<%--This step is important--%>
&LT;TD id= "Demo2" align= "center" valign= "Bottom" >
</td>
</tr>
</table>
</div>
<script>
The speed of scrolling, the greater the number, the slower the speed
var speed = 20
demo2.innerhtml = demo1.innerhtml
From right to left
function Marquee () {
if (demo1.offsetwidth-demo.scrollleft <= 0)
Demo.scrollleft = 0
Else
demo.scrollleft++
} www.jb51.net
var MyMar = setinterval (Marquee, speed)
Demo.onmouseover = function () {clearinterval (MyMar)}
Demo.onmouseout = function () {MyMar = SetInterval (Marquee, Speed)}
</script>

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.