欢迎光临
我们一直在努力

asp如何实现图片的动态翻动的效果asp如何实现图片的动态翻动的效果-ASP教程,ASP应用

建站超值云服务器,限时71元/月

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)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » asp如何实现图片的动态翻动的效果asp如何实现图片的动态翻动的效果-ASP教程,ASP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章