Foreground HTML and JS script:
[HTML]
Copy Code code as follows:
<div>
<table border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
<TD bgcolor= "#CC66FF"
Style= "width:990px; height:5px; Background-color: #ffffff; Text-align:center; " >
</td>
</tr>
<tr>
<TD style= "Border-right: #cccc99 1px solid; Border-top: #cccc99 1px solid; Border-left: #cccc99 1px solid; width:990px; Border-bottom: #cccc99 1px solid ">
<table border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
<TD style= "width:990px; Background-color: #ffffff ">
<div style= "width:990px; Height:139px ">
<div id= "Demo"
Style= "padding-right:0px; padding-left:0px; padding-bottom:0px; Overflow:hidden; width:100%; COLOR: #ffffff; padding-top:0px ">
<table align= "left" border= "0" cellpadding= "0" cellspace= "0" cellspacing= "0"
Style= "width:900px; Height:139px ">
<tr>
<TD id= "Demo1" valign= "Top" >
<table border= "0" cellpadding= "0" cellspacing= "0" width= ">"
<tr> <asp:label id= "Label1" runat= "Server" text= "Label" ></asp:Label>
</tr>
</table>
</td>
<TD id= "Demo2" valign= "Top" >
</td>
</tr>
</table>
</div>
<script __designer:dtid= "3377854339350821" >
var speed3=1//speed is more slow
Demo2.innerhtml=demo1.innerhtml
function Marquee () {
if (demo2.offsetwidth-demo.scrollleft<=0)
Demo.scrollleft-=demo1.offsetwidth
else{
demo.scrollleft++
}
}
var mymar=setinterval (MARQUEE,SPEED3)
Demo.onmouseover=function () {clearinterval (MyMar)}
Demo.onmouseout=function () {Mymar=setinterval (MARQUEE,SPEED3)}
</SCRIPT>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<TD style= "width:100px; height:5px ">
</td>
</tr>
</table>
</div>
Code for CS Page:
[CSharp]
Copy Code code as follows:
Dal_collection dc = new Dal_collection ();
Label1.Text = DC. Getindexzoumadeng ();
Code for Dal_collection.getindexzoumadeng ():
[CSharp]
Copy Code code as follows:
[CSharp]
Copy Code code as follows:
public string Getindexzoumadeng ()
{
StringBuilder res = new StringBuilder ();
DataTable dt0 = Getnewspagedb ("Select Top cn_id, cn_title,cn_intro,cn_url,cn_uid,cn_times to Collection order by Cn_ Times desc ");
if (dt0. Rows.Count = 0)
{
Res. Append ("No relevant data!") ");
}
Else
{
for (int i = 0; i < dt0. Rows.Count; i++)//See "Note 1"
{
Res. Append ("<td align=\" Center\ "height=\" 139\ "width=\" 184\ "></td>);
}
if (dt0. Rows.Count <= 6)
{
Res. Append (Res. ToString ());
}
}
return Res. ToString ();
}