关闭

一页上显示多个图片自动切换

标签: javascripttransitionsqlfilterborderfloat
1042人阅读 评论(0) 收藏 举报
分类:
<%    
dim i,j,pic,pagenum    
   
if cint(request("id"))<=0 then    
sql
="select * from news where type=0 order by orders,id desc"   
else    
sql
="select * from news where id="&cint(request("id"))    
end if    
   
rs.open sql,conn,
1,1    
rs.pagesize
=5    
   
if cint(request("page"))>rs.pagecount or cint(request("page"))<=0 then     
pagenum
=1    
else    
pagenum
=cint(request("page"))    
end if    
   
i
=0    
rs.move (pagenum
-1)*rs.pagesize    
do while not (rs.eof or i>=rs.pagesize)    
%
>    
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">    
<tr><td><hr style="height:1px"></td></tr>    
<tr><td>    
<%    
response.write 
"<b>"&rs("title")"</b>"   
sql
="select * from newspic where parent="&rs("id")" order by orders,id desc"   
rs2.open sql,conn,
1,1    
   
if not rs2.eof then    
   
response.write 
"<script language=JavaScript>"   
response.write 
"var imgUrl"&cint(i+1)"=new Array();"   
response.write 
"var imgLink"&cint(i+1)"=new Array();"   
response.write 
"var text"&cint(i+1)"=new Array();"   
response.write 
"var adNum"&cint(i+1)"=0;"   
response.write 
"var i"&cint(i+1)"=0;"   
 j
=0    
 
do while not rs2.eof    
 j
=j+1    
 response.write 
"imgUrl"&cint(i+1)"["&j"]=""../pic/"&rs2("pic")""";"   
 response.write 
"imgLink"&cint(i+1)"["&j"]=""../pic/"&rs2("pic")""";"   
 response.write 
"text"&cint(i+1)"["&j"]="""";"   
 rs2.movenext    
 
loop    
response.write 
"var imgPre"&cint(i+1)"=new Array();"   
response.write 
"var j"&cint(i+1)"=0;"   
response.write 
"for (i"&cint(i+1)"=1;i"&cint(i+1)"<="&j";i"&cint(i+1)"++) {"   
response.write 
" if( (imgUrl"&cint(i+1)"[i"&cint(i+1)"]!='') && (imgLink"&cint(i+1)"[i"&cint(i+1)"]!='') ) {"   
response.write 
"  j"&cint(i+1)"++;"   
response.write 
" } else {"   
response.write 
"  break;"   
response.write 
" }"   
response.write 
"}"   
   
response.write 
"function playTran"&cint(i+1)"(){"   
response.write 
" if (document.all)"   
response.write 
"  imgInit"&cint(i+1)".filters.revealTrans.play();"   
response.write 
"}"   
   
response.write 
"var key"&cint(i+1)"=0;"   
response.write 
"function nextAd"&cint(i+1)"(){"   
response.write 
" if(adNum"&cint(i+1)"<j"&cint(i+1)")adNum"&cint(i+1)"++ ;"   
response.write 
" else adNum"&cint(i+1)"=1;"   
     
response.write 
" if( key"&cint(i+1)"==0 ){"   
response.write 
"  key"&cint(i+1)"=1;"   
response.write 
" } else if (document.all){"   
response.write 
"  imgInit"&cint(i+1)".filters.revealTrans.Transition=23;"   
response.write 
"  imgInit"&cint(i+1)".filters.revealTrans.apply();"   
response.write 
" }"   
response.write 
" document.images.imgInit"&cint(i+1)".src=imgUrl"&cint(i+1)"[adNum"&cint(i+1)"];"   
response.write 
" playTran"&cint(i+1)"();"   
response.write 
" theTimer=setTimeout(""nextAd"&cint(i+1)"()"", 4000);"   
response.write 
"}"   
   
response.write 
"function goUrl"&cint(i+1)"(XXX){"   
response.write 
" jumpUrl"&cint(i+1)"=imgLink"&cint(i+1)"[adNum"&cint(i+1)"];"   
response.write 
" jumpTarget"&cint(i+1)"='_blank';"   
response.write 
" if (jumpUrl"&cint(i+1)" != ''){"   
response.write 
"  if (jumpTarget"&cint(i+1)" != '') "   
response.write 
"{var newwin"&cint(i+1)";"   
response.write 
"newwin"&cint(i+1)" = window.open('text.htm','_blank','location=0,status=0,toolbar=0,menubar=0,scrollbars=auto,directories=0,resizable=0,width=500,height=300,center=1');"   
response.write 
"newwin"&cint(i+1)".document.writeln('<html><title>pic</title><body oncontextmenu=window.event.returnValue=false bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0><img src='+XXX+' width=500 height=300></body></html>');}"   
response.write 
"  else "   
response.write 
"   location.href=jumpUrl"&cint(i+1)";"   
response.write 
" }"   
response.write 
"}</script>"   
%
>    
</td></tr>    
<tr><td>    
<a href="#" onClick="javascript:goUrl<%=cint(i+1)%>(imgLink<%=cint(i+1)%>[adNum<%=cint(i+1)%>])"><img style="float:<% if rs("click")=0 then response.write "left" else response.write "right" end if %>;FILTER: revealTrans(duration=2,transition=20);border-color:#000000;border-width:1px;margin:8px" src="javascript:nextAd<%=cint(i+1)%>()" name=imgInit<%=cint(i+1)%>></a>    
<%    
else     
response.write 
"<br>"   
end if    
response.write rs(
"text")    
%
>    
</td></tr>    
</table>    
<%    
rs2.close    
i
=i+1    
rs.movenext    
loop    
%
>    
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:35482次
    • 积分:693
    • 等级:
    • 排名:千里之外
    • 原创:15篇
    • 转载:45篇
    • 译文:0篇
    • 评论:0条
    文章分类