一个不错的从数据库读取图片的跑马灯代码
2010-06-04 16:01
519 查看
<TABLE cellSpacing=0 cellPadding=0 width="50%" align=center
border=0>
<TBODY>
<TR>
<TD colSpan=2 height=10></TD>
</TR>
<TR>
<TD colSpan=2 height=136 style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px">
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 700px; HEIGHT: 190px">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD id=demo1 vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD>
<TABLE border=1 cellPadding=0 cellSpacing=0 bordercolor="#000000">
<TBODY>
<TR><td>
<%
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.open "Select top 20 * from 123 where tj=1",conn,1,1
Do while not rs.eof
%></td>
<td width="700" align="center"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="130" align="center"><table border="0" cellpadding="0" cellspacing="1" >
<tr>
<td width="200" height="150" align="center" bgcolor="#FFFFFF"><a href='product1.asp?id=<%=rs("id")%>' target="_blank" title='<%=rs("title")%>'> <img border="0" height="150" src="<%if rs("pic1")="" then%>no.gif<%else%>admin/<%=rs("pic")%><%end if%>" width="200" alt="<%=rs("title")%>" align="center" /></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="5" align="center"></td>
</tr>
<tr>
<td align="center"><table width="100%" border="0" cellpadding="0" cellspacing="1" >
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" style="font-size:12px"><%=rs("title")%></td>
</tr>
</table></td>
</tr>
</table> </td>
<%
rs.movenext
loop
rs.close
Set rs=nothing
%>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD id=demo2
vAlign=top></TD>
</TR>
</TBODY></TABLE></DIV>
<SCRIPT>
var speed=10
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</SCRIPT>
</TD>
<td width="10" ></td>
</TR>
<TR>
<TD width=38 bgColor=#F1F1F1 height=1></TD>
<TD width=300 bgColor=#F1F1F1 height=1></TD>
</TR>
<TR>
<TD colSpan=2
height=10></TD>
</TR>
</TBODY>
</TABLE>
border=0>
<TBODY>
<TR>
<TD colSpan=2 height=10></TD>
</TR>
<TR>
<TD colSpan=2 height=136 style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px">
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 700px; HEIGHT: 190px">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD id=demo1 vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD>
<TABLE border=1 cellPadding=0 cellSpacing=0 bordercolor="#000000">
<TBODY>
<TR><td>
<%
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.open "Select top 20 * from 123 where tj=1",conn,1,1
Do while not rs.eof
%></td>
<td width="700" align="center"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="130" align="center"><table border="0" cellpadding="0" cellspacing="1" >
<tr>
<td width="200" height="150" align="center" bgcolor="#FFFFFF"><a href='product1.asp?id=<%=rs("id")%>' target="_blank" title='<%=rs("title")%>'> <img border="0" height="150" src="<%if rs("pic1")="" then%>no.gif<%else%>admin/<%=rs("pic")%><%end if%>" width="200" alt="<%=rs("title")%>" align="center" /></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="5" align="center"></td>
</tr>
<tr>
<td align="center"><table width="100%" border="0" cellpadding="0" cellspacing="1" >
<tr>
<td height="27" align="center" bgcolor="#FFFFFF" style="font-size:12px"><%=rs("title")%></td>
</tr>
</table></td>
</tr>
</table> </td>
<%
rs.movenext
loop
rs.close
Set rs=nothing
%>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD id=demo2
vAlign=top></TD>
</TR>
</TBODY></TABLE></DIV>
<SCRIPT>
var speed=10
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</SCRIPT>
</TD>
<td width="10" ></td>
</TR>
<TR>
<TD width=38 bgColor=#F1F1F1 height=1></TD>
<TD width=300 bgColor=#F1F1F1 height=1></TD>
</TR>
<TR>
<TD colSpan=2
height=10></TD>
</TR>
</TBODY>
</TABLE>
相关文章推荐
- 从数据库中读取一个图片并保存为一个图片文件[转]
- 从数据库中读取一个图片并保存为一个图片文件
- 一个不错的,JavaScript代码,显示首页图片幻灯片效果
- 我刚做的一个TreeView的CheckBox进行选中插入数据库,从数据库中读取数据后让CheckBox勾选的代码!
- asp.net mvc 从数据库中读取图片的实现代码
- 一个不错的给图片添加说明文字的动态层的代码
- Java代码之JDBC实现数据库之间定时的表格传输(由一个库读取到另一个库)实例
- ASP.NET中常用功能代码总结(上传图片到数据库,从数据库中读取图片)
- 一个不错的给图片添加说明文字的动态层的实现代码
- asp.net mvc 从数据库中读取图片的实现代码
- ASP.NET中常用功能代码总结(上传图片到数据库,从数据库中读取图片)
- 毕业设计——人脸检测——004 学习别人代码——《matlab读取一个目录下的所有图片》
- 一个不错的,JavaScript代码,显示首页图片幻灯片效果
- Windowform 窗体关联数据库存储,读取图片,参考代码
- 从数据库中读取一个图片并保存为一个图片文件
- ASP.NET中常用功能代码总结(上传图片到数据库,从数据库中读取图片)
- android将图片转换存到数据库再从数据库读取转换成图片实现代码
- 一个不错的给图片添加说明文字的动态层的实现代码
- 【转】我刚做的一个TreeView的CheckBox进行选中插入数据库,从数据库中读取数据后让CheckBox勾选的代码!