<div id=demo style="OVERFLOW: hidden; WIDTH: 770px; align: center">
<table border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ECE9D8">
<tbody>
<tr bgcolor="#FFFFFF">
<td valign="top" id="marquePic1">
<table width="770" height="130" border="0" cellpadding="0" cellspacing="0">
<tr>
<%set rs=server.createobject("adodb.recordset")
sql="select top 8 * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=1 order by SMT_id desc"
rs.open sql,conn,1,1
n=0
dowhilenot rs.eof
n=n+1
cpname=rs("SMT_cpname")%>
<td valign=top>
<table width="190" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=100 height=80 style="border:1px #000000 solid"></a></td>
</tr>
<tr>
<td align="center" bgcolor=#efefef style="border-top:1px #cccccc solid"><strong><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank" class=black><%=LeftT(cpname,12)%></a></strong></td>
</tr>
</table>
</td>
<%if n mod9=0then response.write"</tr><tr bgcolor=#ffffff>"
rs.movenext
loop
rs.close%>
</tr>
</table>
</td>
<td valign="top" id="marquePic2"></td>
</tr>
</tbody>
</table>
</div>
<script type=text/javascript>
var speed=30
marquePic2.innerHTML=marquePic1.innerHTML
function Marquee(){
if(demo.scrollLeft>=marquePic1.scrollWidth){
demo.scrollLeft=0
}else{
demo.scrollLeft++
}}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<table border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ECE9D8">
<tbody>
<tr bgcolor="#FFFFFF">
<td valign="top" id="marquePic1">
<table width="770" height="130" border="0" cellpadding="0" cellspacing="0">
<tr>
<%set rs=server.createobject("adodb.recordset")
sql="select top 8 * from SMT_cp where SMT_key=1 and SMT_key1=1 and SMT_key2=1 and SMT_key3=1 order by SMT_id desc"
rs.open sql,conn,1,1
n=0
dowhilenot rs.eof
n=n+1
cpname=rs("SMT_cpname")%>
<td valign=top>
<table width="190" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank"><img src="<%=rs("SMT_pic")%>" border="0" width=100 height=80 style="border:1px #000000 solid"></a></td>
</tr>
<tr>
<td align="center" bgcolor=#efefef style="border-top:1px #cccccc solid"><strong><a href=cp_view.asp?id=<%=rs("SMT_id")%> target="_blank" class=black><%=LeftT(cpname,12)%></a></strong></td>
</tr>
</table>
</td>
<%if n mod9=0then response.write"</tr><tr bgcolor=#ffffff>"
rs.movenext
loop
rs.close%>
</tr>
</table>
</td>
<td valign="top" id="marquePic2"></td>
</tr>
</tbody>
</table>
</div>
<script type=text/javascript>
var speed=30
marquePic2.innerHTML=marquePic1.innerHTML
function Marquee(){
if(demo.scrollLeft>=marquePic1.scrollWidth){
demo.scrollLeft=0
}else{
demo.scrollLeft++
}}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
实例
<div id=demo style="OVERFLOW: hidden; WIDTH: 420px; align: center"> <table border="0" align="center" cellpadding="0" cellspacing="1"> <tbody> <tr bgcolor="#FFFFFF"> <td valign="top" id="marquePic1"> <table width="770" border="0" cellpadding="0" cellspacing="0"> <tr> <%set rs_Product=server.createobject("adodb.recordset") sqltext="select top 9 * from Product where Passed=True order by UpdateTime desc" rs_Product.open sqltext,conn,1,1 n=0 do while not rs_Product.EOF n=n+1 %> <td valign=top > <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td align="center" width="118" height="92" align="center" valign="middle"><a href=ProductShow.asp?ID=<%=rs_Product("id")%> target="_blank"><img src="<%=rs_Product("DefaultPicUrl")%>" border="0" width=118 height=92 style="border:1px #000000 solid"></a></td> </tr> <tr> <td align="center" bgcolor=#efefef style="border-top:1px #cccccc solid"><strong><a href=Product_Show.asp?ID=<%=rs_Product("id")%> target="_blank" class=black><%=rs_Product("Title")%></a></strong></td> </tr> </table> </td> <%if n mod 9=0 and n<>9 then response.write"</tr><tr>" rs_Product.movenext loop rs_Product.close%> </tr> </table> </td> <td valign="top" id="marquePic2"></td> </tr> </tbody> </table> </div> <script type=text/javascript> var speed=30 marquePic2.innerHTML=marquePic1.innerHTML function Marquee(){ if(demo.scrollLeft>=marquePic1.scrollWidth){ demo.scrollLeft=0 }else{ demo.scrollLeft++ }} var MyMar=setInterval(Marquee,speed) demo.onmouseover=function() {clearInterval(MyMar)} demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} </script>