<tr><td><input type=button value='<' name=lefts onclick="leftimg();"></td>
<%set rs=server.createobject("adodb.recordset")
rs.open "select top 3 * from table order by id desc",conn,1,1
ii=1
do while not rs.eof%>
<td><img src='<%=rs("img")%>' id='img<%=ii%>'><br><div id='txt<%=ii%>'><%=rs("title")%></div></td>
<%ii=ii+1
rs.movenext
loop
rs.close
set rs=nothing
%>
<td><input type=button value='>' name=rights onclick="rightimg();"></td>
</tr>
<script>
var imgarray=new array();
var txtarray=new array();
var ipos=0;
<%set rs=server.createobject("adodb.recordset")
rs.open "select top 5 * from table order by id desc",conn,1,1
ii=0
do while not rs.eof%>
imgarray[<%=ii%>]="<%=rs("img")%>";
txtarray[<%=ii%>]="<%=rs("title")%>";
<%
ii=ii+1
rs.movenext
loop
rs.close
set rs=nothing%>
function leftimg(){
ipos++;
ipos2=ipos;
if(ipos2>4){ipos2=0;ipos=0}
img1.src=imgarray[ipos2];
txt1.innerhtml=txtarray[ipos2];
ipos2++;
if(ipos2>4){ipos2=0}
img2.src=imgarray[ipos2]
txt2.innerhtml=txtarray[ipos2];
ipos2++;
if(ipos2>4){ipos2=0}
img3.src=imgarray[ipos2]
txt3.innerhtml=txtarray[ipos2];
}
function rightimg(){
ipos--;
ipos2=ipos;
if(ipos2<0){ipos2=4;ipos=4}
img1.src=imgarray[ipos2]
txt1.innerhtml=txtarray[ipos2];
ipos2++;
if(ipos2>4){ipos2=0}
img2.src=imgarray[ipos2]
txt2.innerhtml=txtarray[ipos2];
ipos2++;
if(ipos2>4){ipos2=0}
img3.src=imgarray[ipos2]
txt3.innerhtml=txtarray[ipos2];
}
</script>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器