asp 表格 图片 循环
我要实现一个效果,在网页下部显示一行图片,从数据库读取的,图片循环滚动,代码如下<%sql="selecttop11*fromNEWSwherefirstImageNam...
我要实现一个效果,在网页下部显示一行图片,从数据库读取的,图片循环滚动,代码如下
<%
sql="select top 11 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
do while not rs.eof
%>
<%if not rs.eof then%>
循环部分
<table width="121" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><div align="center" ><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><img
src="uppic/<%=trim(rs("firstImageName"))%>" width="100"
height="90" border="0"></a></div></td>
</tr>
<tr>
<td height="25" align="center"><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),8)%></a></td>
</tr>
</table>
循环结束
<%else%>
response.write "尚无收录"
<%end if%>
<% rs.movenext
loop
end if
rs.close%>
在线等 展开
<%
sql="select top 11 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
do while not rs.eof
%>
<%if not rs.eof then%>
循环部分
<table width="121" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><div align="center" ><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><img
src="uppic/<%=trim(rs("firstImageName"))%>" width="100"
height="90" border="0"></a></div></td>
</tr>
<tr>
<td height="25" align="center"><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),8)%></a></td>
</tr>
</table>
循环结束
<%else%>
response.write "尚无收录"
<%end if%>
<% rs.movenext
loop
end if
rs.close%>
在线等 展开
展开全部
<HTML><HEAD><TITLE>无标题文档</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR>
<link href="css.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY leftMargin=0 topMargin=2 marginheight="0" marginwidth="0">
<CENTER>
<TABLE
style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid"
cellSpacing=0 cellPadding=0 width=750 align=center border=0>
<TBODY>
<TR>
<TD>
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
<TBODY>
<TR>
<TD id=demo1 vAlign=top><table width="1710" height="116" border="0" cellpadding="0" cellspacing="0">
<%
sql="select top 11 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
do while not rs.eof
%>
<%if not rs.eof then%>
<tr>
<td align="center"><div align="center" ><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><img
src="uppic/<%=trim(rs("firstImageName"))%>" width="100"
height="90" border="0"></a></div></td>
</tr>
<tr>
<td height="25" align="center"><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),8)%></a></td>
</tr>
</table></TD>
<TD id=demo2 vAlign=top> </TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed3=25//速度数值越大速度越慢
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>
</TD></TR></TBODY></TABLE></TD></TR></TABLE>
</CENTER>
</BODY></HTML>
框架自己再调整一下
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR>
<link href="css.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY leftMargin=0 topMargin=2 marginheight="0" marginwidth="0">
<CENTER>
<TABLE
style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid"
cellSpacing=0 cellPadding=0 width=750 align=center border=0>
<TBODY>
<TR>
<TD>
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
<TBODY>
<TR>
<TD id=demo1 vAlign=top><table width="1710" height="116" border="0" cellpadding="0" cellspacing="0">
<%
sql="select top 11 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
do while not rs.eof
%>
<%if not rs.eof then%>
<tr>
<td align="center"><div align="center" ><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><img
src="uppic/<%=trim(rs("firstImageName"))%>" width="100"
height="90" border="0"></a></div></td>
</tr>
<tr>
<td height="25" align="center"><a href="onews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),8)%></a></td>
</tr>
</table></TD>
<TD id=demo2 vAlign=top> </TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed3=25//速度数值越大速度越慢
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>
</TD></TR></TBODY></TABLE></TD></TR></TABLE>
</CENTER>
</BODY></HTML>
框架自己再调整一下
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这效果需要用JAVASCRIPT来实现。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
QQ我帮你解决!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
QQ:7137462 找我吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询