你加那么多Option干嘛?Pic[0]=new option(document.tpxw.pic0.value,"");
Pic[1]=new option(document.tpxw.pic1.value,"");
Pic[2]=new option(document.tpxw.pic2.value,"");
Pic[3]=new option(document.tpxw.pic3.value,"");
Pic[4]=new option(document.tpxw.pic4.value,"");Link[0]=new option(document.tpxw.link0.value,"");
Link[1]=new option(document.tpxw.link1.value,"");
Link[2]=new option(document.tpxw.link2.value,"");
Link[3]=new option(document.tpxw.link3.value,"");
Link[4]=new option(document.tpxw.link4.value,"");Textc[0]=new option(document.tpxw.textc0.value,"");
Textc[1]=new option(document.tpxw.textc1.value,"");
Textc[2]=new option(document.tpxw.textc2.value,"");
Textc[3]=new option(document.tpxw.textc3.value,"");
Textc[4]=new option(document.tpxw.textc4.value,"");上面那里替换为
你最上面的数据库循环
Pic[<%=i%>]="<%=rdm("picnewsa")%>";
Link[<%=i%>]="<%=rdm("lpath")&rdm("filename")%>"
Textc[<%=i%>]="<%=rdm("title")%>"
Pic[1]=new option(document.tpxw.pic1.value,"");
Pic[2]=new option(document.tpxw.pic2.value,"");
Pic[3]=new option(document.tpxw.pic3.value,"");
Pic[4]=new option(document.tpxw.pic4.value,"");Link[0]=new option(document.tpxw.link0.value,"");
Link[1]=new option(document.tpxw.link1.value,"");
Link[2]=new option(document.tpxw.link2.value,"");
Link[3]=new option(document.tpxw.link3.value,"");
Link[4]=new option(document.tpxw.link4.value,"");Textc[0]=new option(document.tpxw.textc0.value,"");
Textc[1]=new option(document.tpxw.textc1.value,"");
Textc[2]=new option(document.tpxw.textc2.value,"");
Textc[3]=new option(document.tpxw.textc3.value,"");
Textc[4]=new option(document.tpxw.textc4.value,"");上面那里替换为
你最上面的数据库循环
Pic[<%=i%>]="<%=rdm("picnewsa")%>";
Link[<%=i%>]="<%=rdm("lpath")&rdm("filename")%>"
Textc[<%=i%>]="<%=rdm("title")%>"
其实就是输出javascript代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<SCRIPT language=Javascript>
var slideShowSpeed = 5000;
var crossFadeDuration = 3;
var hrefBasicPath='http://localhost/gads/www/news/';
var Pic= new Array();
var Link=new Array();
var Textc=new Array();
<%on error resume next
set cn=server.createobject("adodb.connection")
db = Server.MapPath("../www/news/fsmanage/database/#weblinkdate06.asa")
cn.Open "Provider=Microsoft.JET.OLEDB.4.0;User Id=Admin;Data Source = " & db
sqlm="select top 5 * from news where picnews=true and picnewsi=true order by date desc"
set rdm=cn.execute(sqlm)
i=0
do while not rdm.eof%>Pic[<%=i%>]="<%=rdm("picnewsa")%>";Link[<%=i%>]="<%=rdm("lpath")&rdm("filename")&".html"%>";
Textc[<%=i%>]="<%=rdm("title")%>";
<%rdm.movenext
i=i+1
looprdm.close
cn.close
set rdm=nothing
set cn=nothing
%>var t;
var j=0;
var p=Pic.length;
var preLoad=new Array();
for(i=0;i<p;i++){
preLoad[i] =new Image();
preLoad[i].src=Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
document.all.aName.href=hrefBasicPath+Link[j];
textCon.innerHTML=Textc[j];
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', 5000);
}
</SCRIPT>
<html>
<head><title></title>
<SCRIPT>
var val=1 ;
function wait()
{
if(val==1)
{
setTimeout("wait()",60000) ;
val-- ;
}
else
{
image.style.display='none' ;
}
}</SCRIPT><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body,td,th {
font-family: Times New Roman, Times, serif;
font-size: 12px;
color: #333333;
}
-->
</style></head>
<body topMargin=0 leftmargin=0 onload=runSlideShow();wait();>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td valign="top"><div align="center"><A target=_blank name=aName><IMG id=SlideShow height=142 width=163 border=0 name=SlideShow></A></td></tr>
<tr><td height="2"></td></tr>
<tr><td id=textCon align=middle height=20 valign="top" ></td></tr></table>
</body>
</html>