关于一个JS图片问题!!!ASP高手请进~在线等!!
for(j=1;j<6;j++){<%dowhilenotrs.eof%>imgUrl[j]="<%=rs("img")%>";imgLink[j]="#";imgTz[...
for (j=1;j<6;j++)
{
<%
do while not rs.eof%>
imgUrl[j]="<%=rs("img")%>";
imgLink[j]="#";
imgTz[j]="设计师:<%=rs("title")%>";
<%rs.movenext
loop
%>
}
<%rs.close %>
看看这段循环怎么写!````!~~~~```
图片重数据库已经调出来了!~`但是就只是从数据库里面调ID1出来!~~
就是不循环第2个!~~~`
<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from design order by id desc"
rs.open sqltext,conn,1,1
%>
<!--begin:图片轮换开始-->
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var imgTz=new Array();
var buttonShow=1;
var buttonPos=1;
var buttonX;
var buttonY;
var bakularCode=""
var adNum=0;
var dakularCode="";
for (j=1;j<6;j++)
{
<%
do while not rs.eof%>
imgUrl[j]="<%=rs("img")%>";
imgLink[j]="#";
imgTz[j]="设计师:<%=rs("title")%>";
<%rs.movenext
loop
%>
}
<%rs.close %>
var imgPre=new Array();
for (i=1;i<8;i++)
{
imgPre[i]=new Image();
imgPre[i].src=imgUrl[i];
}
function setTransition()
{
if (document.all)
{
imgUrlrotator.filters.revealTrans.Transition=23;//Math.floor(Math.random()*23)
imgUrlrotator.filters.revealTrans.apply();
}
}
function playTransition()
{
if (document.all)
imgUrlrotator.filters.revealTrans.play()
}
function nextAd(toNum)
{
if(adNum<imgUrl.length-1)
adNum++ ;
else
adNum=1;
if(toNum!=null) adNum=toNum;
setTransition();
document.images.imgUrlrotator.src=imgUrl[adNum];
document.getElementById('linktext').innerHTML=imgTz[adNum];
document.images.imgUrlrotator.alt='设计之星-->'+imgTz[adNum];
document.getElementById('linktext').innerHTML="<a href="+imgLink[adNum]+" target=_blank class=px14-lh20>"+imgTz[adNum]+"</a>";
playTransition();
}
function jump2url()
{
jumpUrl=imgLink[adNum];jumpTarget='_blank';
if (jumpUrl != '')
{ if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg()
{
status=imgLink[adNum];
document.returnValue = true;
}
</script>
<table border="0" cellpadding="0" cellspacing="0" id=table149 style="position:relative; top:1px;right:0px; font-size:12px;" width="156">
<tr>
<td height="193">
<p align="center">
<a onMouseOver="return document.returnValue;" onMouseOut="status='';" href="javascript:jump2url()">
<img style="FILTER: revealTrans(duration=1,transition=18); border:1px solid #ffffff" src="javascript:nextAd()" width=151 height=173 border=0 name=imgUrlrotator alt="今日头条">
</a>
</td>
</tr>
<tr><td bgcolor="#f0f0f0" align="center" style="border-bottom:1px solid #ffffff; border-left:1px solid #ffffff;border-right:1px solid #ffffff;" height="15"><label id="linktext"></label></td></tr>
</table>
<script language="javascript">
window.setInterval("nextAd()",5000)
</script>
<!--begin:图片轮换结束-->
这个是全代码!~~ 展开
{
<%
do while not rs.eof%>
imgUrl[j]="<%=rs("img")%>";
imgLink[j]="#";
imgTz[j]="设计师:<%=rs("title")%>";
<%rs.movenext
loop
%>
}
<%rs.close %>
看看这段循环怎么写!````!~~~~```
图片重数据库已经调出来了!~`但是就只是从数据库里面调ID1出来!~~
就是不循环第2个!~~~`
<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from design order by id desc"
rs.open sqltext,conn,1,1
%>
<!--begin:图片轮换开始-->
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var imgTz=new Array();
var buttonShow=1;
var buttonPos=1;
var buttonX;
var buttonY;
var bakularCode=""
var adNum=0;
var dakularCode="";
for (j=1;j<6;j++)
{
<%
do while not rs.eof%>
imgUrl[j]="<%=rs("img")%>";
imgLink[j]="#";
imgTz[j]="设计师:<%=rs("title")%>";
<%rs.movenext
loop
%>
}
<%rs.close %>
var imgPre=new Array();
for (i=1;i<8;i++)
{
imgPre[i]=new Image();
imgPre[i].src=imgUrl[i];
}
function setTransition()
{
if (document.all)
{
imgUrlrotator.filters.revealTrans.Transition=23;//Math.floor(Math.random()*23)
imgUrlrotator.filters.revealTrans.apply();
}
}
function playTransition()
{
if (document.all)
imgUrlrotator.filters.revealTrans.play()
}
function nextAd(toNum)
{
if(adNum<imgUrl.length-1)
adNum++ ;
else
adNum=1;
if(toNum!=null) adNum=toNum;
setTransition();
document.images.imgUrlrotator.src=imgUrl[adNum];
document.getElementById('linktext').innerHTML=imgTz[adNum];
document.images.imgUrlrotator.alt='设计之星-->'+imgTz[adNum];
document.getElementById('linktext').innerHTML="<a href="+imgLink[adNum]+" target=_blank class=px14-lh20>"+imgTz[adNum]+"</a>";
playTransition();
}
function jump2url()
{
jumpUrl=imgLink[adNum];jumpTarget='_blank';
if (jumpUrl != '')
{ if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg()
{
status=imgLink[adNum];
document.returnValue = true;
}
</script>
<table border="0" cellpadding="0" cellspacing="0" id=table149 style="position:relative; top:1px;right:0px; font-size:12px;" width="156">
<tr>
<td height="193">
<p align="center">
<a onMouseOver="return document.returnValue;" onMouseOut="status='';" href="javascript:jump2url()">
<img style="FILTER: revealTrans(duration=1,transition=18); border:1px solid #ffffff" src="javascript:nextAd()" width=151 height=173 border=0 name=imgUrlrotator alt="今日头条">
</a>
</td>
</tr>
<tr><td bgcolor="#f0f0f0" align="center" style="border-bottom:1px solid #ffffff; border-left:1px solid #ffffff;border-right:1px solid #ffffff;" height="15"><label id="linktext"></label></td></tr>
</table>
<script language="javascript">
window.setInterval("nextAd()",5000)
</script>
<!--begin:图片轮换结束-->
这个是全代码!~~ 展开
展开全部
for (j=1;j<6;j++)
{
<%
do while not rs.eof%>
imgUrl[j]="<%=rs("img")%>";
imgLink[j]="#";
imgTz[j]="设计师:<%=rs("title")%>";
<%rs.movenext
loop
%>
===============改=>
<%
for i = 1 to rs.recordcount %>
imgUrl[<%= i %>]="<%=rs("img")%>";
imgLink[<%= i %>]="#";
imgTz[<%= i %>]="设计师:<%=rs("title")%>";
<% rs.movenext
next %>
{
<%
do while not rs.eof%>
imgUrl[j]="<%=rs("img")%>";
imgLink[j]="#";
imgTz[j]="设计师:<%=rs("title")%>";
<%rs.movenext
loop
%>
===============改=>
<%
for i = 1 to rs.recordcount %>
imgUrl[<%= i %>]="<%=rs("img")%>";
imgLink[<%= i %>]="#";
imgTz[<%= i %>]="设计师:<%=rs("title")%>";
<% rs.movenext
next %>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询