RSS
热门关键字:  数据挖掘  数据仓库  商业智能  人工智能  搜索引擎
当前位置 :| 首页>编程技术>asp编程>

asp如何实现图片的动态翻动的效果asp如何实现图片的动态翻动的效

来源: 作者:unkonwn 时间:2005-04-14 点击:
http://community.csdn.net/Expert/topic/3722/3722373.xml?temp=.6881372

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



最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
匿名?