定义成数组
然后如何让它有轮显效果?
9 个解决方案
#1
Redim arrey(arreylength)
#2
<script language="JavaScript">
<!--
<%
Dim picstr
picstr="a.gif,b.gif"
%>
var picstr= '<%=picstr%>';
var Pic= picstr.split(",");
//-->
</script>
<!--
<%
Dim picstr
picstr="a.gif,b.gif"
%>
var picstr= '<%=picstr%>';
var Pic= picstr.split(",");
//-->
</script>
#3
楼上正解。
他的原理在于
ASP的文件 首先会被ASP解析
<script src=aaa.asp></script>
然后aaa.asp 文件 被解析的结果 要符后JS规范代码就OK了
他的原理在于
ASP的文件 首先会被ASP解析
<script src=aaa.asp></script>
然后aaa.asp 文件 被解析的结果 要符后JS规范代码就OK了
#4
这贴好,解决一个问题,赚俩贴的分,一个伙计的有问题,我改好了
--------------------------------------------------------------
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
bannerAD[0]="img1.jpg";
bannerADlink[0]="new_view.asp?id=1";
bannerADText[0]="Text";
bannerAD[1]="img2.jpg";
bannerADlink[1]="new_view.asp?id=2";
bannerADText[1]="Text2";
bannerAD[2]="img3.jpg";
bannerADlink[2]="new_view.asp?id=3";
bannerADText[2]="Text3";
bannerAD[3]="img4.jpg";
bannerADlink[3]="new_view.asp?id=4";
bannerADText[3]="Text4";
bannerAD[4]="img5.jpg";
bannerADlink[4]="new_view.asp?id=4";
bannerADText[4]="Text5";
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd();", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
--------------------------------------------------------------
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
bannerAD[0]="img1.jpg";
bannerADlink[0]="new_view.asp?id=1";
bannerADText[0]="Text";
bannerAD[1]="img2.jpg";
bannerADlink[1]="new_view.asp?id=2";
bannerADText[1]="Text2";
bannerAD[2]="img3.jpg";
bannerADlink[2]="new_view.asp?id=3";
bannerADText[2]="Text3";
bannerAD[3]="img4.jpg";
bannerADlink[3]="new_view.asp?id=4";
bannerADText[3]="Text4";
bannerAD[4]="img5.jpg";
bannerADlink[4]="new_view.asp?id=4";
bannerADText[4]="Text5";
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd();", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
#5
up
#6
http://www.alixixi.com/
参考这个站的首页代码
参考这个站的首页代码
#7
我刚调试好的,ASP中动态的呵呵,图文同步显示的
<%function photo()%>
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
<% Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select TOP 5 SMT_id,SMT_news,SMT_title from SMT_xxnews WHERE SMT_news like '%IMG%' order by SMT_id desc",conn,1,1
i=0
if not rs.eof then
do while not rs.eof
txt=rs("SMT_news")
Texts=left(rs("SMT_title"),20)
if InStrRev(txt,"src",len(txt),0)>0 then
txtend=mid(txt,InStrRev(txt,"src",len(txt),0)+5,len(txt))
url=mid(txtend,1,InStr(txtend,chr(34))-1)
%>
bannerAD[<%=i%>]="<%=url%>";
bannerADlink[<%=i%>]="new_view.asp?id=<%=rs("SMT_id")%>";
bannerADText[<%=i%>]="<%=Texts%>";
<%
i=i+1
end if
rs.movenext
if i>5 then exit do
loop
end if
rs.close
%>
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
//同步显示图片
document.images.bannerADrotator.src=bannerAD[adNum];
//用层来同步显示文字
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
<%end function%>
<%function photo()%>
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
<% Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select TOP 5 SMT_id,SMT_news,SMT_title from SMT_xxnews WHERE SMT_news like '%IMG%' order by SMT_id desc",conn,1,1
i=0
if not rs.eof then
do while not rs.eof
txt=rs("SMT_news")
Texts=left(rs("SMT_title"),20)
if InStrRev(txt,"src",len(txt),0)>0 then
txtend=mid(txt,InStrRev(txt,"src",len(txt),0)+5,len(txt))
url=mid(txtend,1,InStr(txtend,chr(34))-1)
%>
bannerAD[<%=i%>]="<%=url%>";
bannerADlink[<%=i%>]="new_view.asp?id=<%=rs("SMT_id")%>";
bannerADText[<%=i%>]="<%=Texts%>";
<%
i=i+1
end if
rs.movenext
if i>5 then exit do
loop
end if
rs.close
%>
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
//同步显示图片
document.images.bannerADrotator.src=bannerAD[adNum];
//用层来同步显示文字
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
<%end function%>
#8
我先看看楼上的。。谢谢各位。还有其它的吗。
#9
使用楼上的方法,已解决。谢谢
#1
Redim arrey(arreylength)
#2
<script language="JavaScript">
<!--
<%
Dim picstr
picstr="a.gif,b.gif"
%>
var picstr= '<%=picstr%>';
var Pic= picstr.split(",");
//-->
</script>
<!--
<%
Dim picstr
picstr="a.gif,b.gif"
%>
var picstr= '<%=picstr%>';
var Pic= picstr.split(",");
//-->
</script>
#3
楼上正解。
他的原理在于
ASP的文件 首先会被ASP解析
<script src=aaa.asp></script>
然后aaa.asp 文件 被解析的结果 要符后JS规范代码就OK了
他的原理在于
ASP的文件 首先会被ASP解析
<script src=aaa.asp></script>
然后aaa.asp 文件 被解析的结果 要符后JS规范代码就OK了
#4
这贴好,解决一个问题,赚俩贴的分,一个伙计的有问题,我改好了
--------------------------------------------------------------
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
bannerAD[0]="img1.jpg";
bannerADlink[0]="new_view.asp?id=1";
bannerADText[0]="Text";
bannerAD[1]="img2.jpg";
bannerADlink[1]="new_view.asp?id=2";
bannerADText[1]="Text2";
bannerAD[2]="img3.jpg";
bannerADlink[2]="new_view.asp?id=3";
bannerADText[2]="Text3";
bannerAD[3]="img4.jpg";
bannerADlink[3]="new_view.asp?id=4";
bannerADText[3]="Text4";
bannerAD[4]="img5.jpg";
bannerADlink[4]="new_view.asp?id=4";
bannerADText[4]="Text5";
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd();", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
--------------------------------------------------------------
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
bannerAD[0]="img1.jpg";
bannerADlink[0]="new_view.asp?id=1";
bannerADText[0]="Text";
bannerAD[1]="img2.jpg";
bannerADlink[1]="new_view.asp?id=2";
bannerADText[1]="Text2";
bannerAD[2]="img3.jpg";
bannerADlink[2]="new_view.asp?id=3";
bannerADText[2]="Text3";
bannerAD[3]="img4.jpg";
bannerADlink[3]="new_view.asp?id=4";
bannerADText[3]="Text4";
bannerAD[4]="img5.jpg";
bannerADlink[4]="new_view.asp?id=4";
bannerADText[4]="Text5";
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd();", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
#5
up
#6
http://www.alixixi.com/
参考这个站的首页代码
参考这个站的首页代码
#7
我刚调试好的,ASP中动态的呵呵,图文同步显示的
<%function photo()%>
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
<% Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select TOP 5 SMT_id,SMT_news,SMT_title from SMT_xxnews WHERE SMT_news like '%IMG%' order by SMT_id desc",conn,1,1
i=0
if not rs.eof then
do while not rs.eof
txt=rs("SMT_news")
Texts=left(rs("SMT_title"),20)
if InStrRev(txt,"src",len(txt),0)>0 then
txtend=mid(txt,InStrRev(txt,"src",len(txt),0)+5,len(txt))
url=mid(txtend,1,InStr(txtend,chr(34))-1)
%>
bannerAD[<%=i%>]="<%=url%>";
bannerADlink[<%=i%>]="new_view.asp?id=<%=rs("SMT_id")%>";
bannerADText[<%=i%>]="<%=Texts%>";
<%
i=i+1
end if
rs.movenext
if i>5 then exit do
loop
end if
rs.close
%>
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
//同步显示图片
document.images.bannerADrotator.src=bannerAD[adNum];
//用层来同步显示文字
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
<%end function%>
<%function photo()%>
<table border="0" width="247" cellspacing="0" cellpadding="0" id="table1" height="80">
<tr>
<td align="center" valign="top">
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var bannerADText=new Array();
var adNum=0;
<% Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"select TOP 5 SMT_id,SMT_news,SMT_title from SMT_xxnews WHERE SMT_news like '%IMG%' order by SMT_id desc",conn,1,1
i=0
if not rs.eof then
do while not rs.eof
txt=rs("SMT_news")
Texts=left(rs("SMT_title"),20)
if InStrRev(txt,"src",len(txt),0)>0 then
txtend=mid(txt,InStrRev(txt,"src",len(txt),0)+5,len(txt))
url=mid(txtend,1,InStr(txtend,chr(34))-1)
%>
bannerAD[<%=i%>]="<%=url%>";
bannerADlink[<%=i%>]="new_view.asp?id=<%=rs("SMT_id")%>";
bannerADText[<%=i%>]="<%=Texts%>";
<%
i=i+1
end if
rs.movenext
if i>5 then exit do
loop
end if
rs.close
%>
var preloadedimages=new Array();
for (i=1;i<4;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
preloadedimages[i].src=bannerADText[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
//同步显示图片
document.images.bannerADrotator.src=bannerAD[adNum];
//用层来同步显示文字
document.all.mydive.innerHTML =bannerADText[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 4000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<a onMouseOver="displayStatusMsg();return document.returnValue"
href="javascript:jump2url();">
<img
style="FILTER: revealTrans(duration=2,transition=20)" height=190
src="javascript:nextAd()" width=247 border=0
name=bannerADrotator></a><BR><BR><div id="mydive"></div>
</td>
</tr>
</table>
<%end function%>
#8
我先看看楼上的。。谢谢各位。还有其它的吗。
#9
使用楼上的方法,已解决。谢谢