争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

asp如何完成图片的动态翻动的效果

时间:2024/6/14作者:未知来源:争怎路由网人气:

<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>





关键词:asp如何完成图片的动态翻动的效果




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版