Continuous Image scrolling (connecting to the database repeat Control)

Source: Internet
Author: User

<Div id = 'Demo' style = 'overflow: hidden; width: 510px; Height: 60px; '>
<Table cellpadding = "0" cellspacing = "0" border = "0">
<Tr>
<TD id = "demo1">
<Table cellpadding = "0" cellspacing = "0" border = "0">
<Tr>
<Asp: repeater id = "rpt_list" runat = "server">
<Itemtemplate>
<TD style = 'padding: 0px 10px 0px 10px; '> <a href = 'HTTP: // www. simply. WS 'target = '_ blank'> 'alt = "<% # eval (" name ") %> "Height =" 60 "border = '0'/> </TD>
</Itemtemplate>
</ASP: repeater>
</Tr>
</Table>
</TD>
<TD id = "demo2"> </TD>
</Tr>
</Table>
</Div>
<Script language = 'javascript '>
VaR speed = 10;
Demo2.innerhtml = demo1.innerhtml
Function marquee (){
If (Demo. scrollleft> = demo2.offsetwidth)
Demo. scrollleft-= demo2.offsetwidth;
Else {
Demo. scrollleft ++;
}
}
VaR mymar = setinterval (marquee, speed)
Demo. onmouseover = function () {clearinterval (mymar )}
Demo. onmouseout = function () {mymar = setinterval (marquee, speed )}

</SCRIPT>

 

 

Backend CS code:

Private void databind ()
{
Oledbconnection conn = new oledbconnection (configurationmanager. connectionstrings ["sqlserverdal"]. connectionstring );
Conn. open ();
Oledbdataadapter ADP = new oledbdataadapter ("select * From t_1_sors order by datetime1 DESC", Conn );
Dataset dataset = new dataset ();
ADP. Fill (dataset, "information ");
Conn. Close ();
This. rpt_list.datasource = dataset;
Rpt_list.databind ();
}

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.