ASP代码求帮忙修改
下面的代码是在数据库中找4张照片然后在页面显示成一排,我想改成把让所有的照片滚动显示的效果,求帮忙,注意照片上是有链接的<%setrs=server.createobje...
下面的代码是在数据库中找4张照片然后在页面显示成一排,我想改成把让所有的照片滚动显示的效果,求帮忙,注意照片上是有链接的
<%
set rs=server.createobject("adodb.recordset")
sql="select top 4 * from news where bigclassid=4 and good=true order by ord desc"
rs.open sql,conn,1,3
for i=1 to rs.recordcount
%>
<td align="center"><table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><img src="<%=rs("d_picture")%>" width="159" height="128" alt="" border="0"></a></div></td>
</tr>
<tr>
<td height="22" align="center"><table width="93%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#F1F1F1">
<tr>
<td align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
</tr>
</table></td>
</tr>
</table></td>
<%
rs.movenext
next
%>
</tr>
</table>
</td> 展开
<%
set rs=server.createobject("adodb.recordset")
sql="select top 4 * from news where bigclassid=4 and good=true order by ord desc"
rs.open sql,conn,1,3
for i=1 to rs.recordcount
%>
<td align="center"><table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><img src="<%=rs("d_picture")%>" width="159" height="128" alt="" border="0"></a></div></td>
</tr>
<tr>
<td height="22" align="center"><table width="93%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#F1F1F1">
<tr>
<td align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
</tr>
</table></td>
</tr>
</table></td>
<%
rs.movenext
next
%>
</tr>
</table>
</td> 展开
展开全部
<div id=demo style="overflow:hidden;width:650px;" align=center>
<table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >
<tr><td valign=top bgcolor=ffffff id=marquePic1>
<table width='100%' border='0' cellspacing='0'><tr><%
set rs=server.createobject("adodb.recordset")
sql="select top 4 * from news where bigclassid=4 and good=true order by ord desc"
rs.open sql,conn,1,3
for i=1 to rs.recordcount
%>
<td align="center"><table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><img src="<%=rs("d_picture")%>" width="159" height="128" alt="" border="0"></a></div></td>
</tr>
<tr>
<td height="22" align="center"><table width="93%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#F1F1F1">
<tr>
<td align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
</tr>
</table></td>
</tr>
</table></td>
<%
rs.movenext
next
%> <td id=marquePic2 valign=top></td></tr>
</table></div>
<script type="text/javascript">
var speed=50
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=1 cellspacing=1 cellspace=0 >
<tr><td valign=top bgcolor=ffffff id=marquePic1>
<table width='100%' border='0' cellspacing='0'><tr><%
set rs=server.createobject("adodb.recordset")
sql="select top 4 * from news where bigclassid=4 and good=true order by ord desc"
rs.open sql,conn,1,3
for i=1 to rs.recordcount
%>
<td align="center"><table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><img src="<%=rs("d_picture")%>" width="159" height="128" alt="" border="0"></a></div></td>
</tr>
<tr>
<td height="22" align="center"><table width="93%" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#F1F1F1">
<tr>
<td align="center"><a href="showhj.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
</tr>
</table></td>
</tr>
</table></td>
<%
rs.movenext
next
%> <td id=marquePic2 valign=top></td></tr>
</table></div>
<script type="text/javascript">
var speed=50
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>
试一下,不行的话再联系我。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
百度搜无缝滚动js代码即可
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询