请教高手asp代码问题,实现现在流行的幻灯片效果! 50
效果已经实现,只是从数据库里读的是三张一样的图片,而且没有链接!代码如下:<scripttype="text/javascript">varswf_width=400va...
效果已经实现,只是从数据库里读的是三张一样的图片,而且没有链接!
代码如下:
<script type="text/javascript">
var swf_width=400
var swf_height=350
<%
set rst2=Server.CreateObject("Adodb.Recordset")
rst2.Open "SELECT * FROM News WHERE N_columnID=0 and N_Special=1 order by N_PubDT DESC",cnn
i=0
Repeat1__numRows = 1
while ((Repeat1__numRows<4)and(not rst2.eof))
zyxw=rst2("N_Title")
zyxw=Replace(zyxw,vbCrLf,"<br>")
CID=rst2("N_ColumnID")
N_newsID=rst2("N_NewsID")
pic=rst2("N_PicURL")
if Len(zyxw)>90 then
zyxw=left(zyxw,90)+"......"
else
zyxw=zyxw
end if
%>
<%
Repeat1__numRows = Repeat1__numRows+1
rst2.MoveNext()
i=i+1
Wend
rst2.close()
set rst2 = Nothing
%>
var files='<%=pic%>|<%=pic%>|<%=pic%>'
var links='shownews.asp?ColumnID=<%=CID%>&N_NewsId=<%=N_newsID%>|'
var texts='<%=zyxw%>|<%=zyxw%>|<%=zyxw%>'
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="hd/bcastr.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">');
document.write('<embed src="hd/bcastr.swf" wmode="opaque" FlashVars="bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
</script>
代码能从数据库里取到图片,但是只能取一张,而且没有链接,N_NewsId变量好像没有传递过来。重点是这些代码:
var files='<%=pic%>|<%=pic%>|<%=pic%>'
var links='shownews.asp?ColumnID=<%=CID%>&N_NewsId=<%=N_newsID%>|'
var texts='<%=zyxw%>|<%=zyxw%>|<%=zyxw%>'
我想实现:图片1 图片2 图片3
连接1 链接2 链接3
文字1 文字2 文字3 展开
代码如下:
<script type="text/javascript">
var swf_width=400
var swf_height=350
<%
set rst2=Server.CreateObject("Adodb.Recordset")
rst2.Open "SELECT * FROM News WHERE N_columnID=0 and N_Special=1 order by N_PubDT DESC",cnn
i=0
Repeat1__numRows = 1
while ((Repeat1__numRows<4)and(not rst2.eof))
zyxw=rst2("N_Title")
zyxw=Replace(zyxw,vbCrLf,"<br>")
CID=rst2("N_ColumnID")
N_newsID=rst2("N_NewsID")
pic=rst2("N_PicURL")
if Len(zyxw)>90 then
zyxw=left(zyxw,90)+"......"
else
zyxw=zyxw
end if
%>
<%
Repeat1__numRows = Repeat1__numRows+1
rst2.MoveNext()
i=i+1
Wend
rst2.close()
set rst2 = Nothing
%>
var files='<%=pic%>|<%=pic%>|<%=pic%>'
var links='shownews.asp?ColumnID=<%=CID%>&N_NewsId=<%=N_newsID%>|'
var texts='<%=zyxw%>|<%=zyxw%>|<%=zyxw%>'
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="hd/bcastr.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">');
document.write('<embed src="hd/bcastr.swf" wmode="opaque" FlashVars="bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
</script>
代码能从数据库里取到图片,但是只能取一张,而且没有链接,N_NewsId变量好像没有传递过来。重点是这些代码:
var files='<%=pic%>|<%=pic%>|<%=pic%>'
var links='shownews.asp?ColumnID=<%=CID%>&N_NewsId=<%=N_newsID%>|'
var texts='<%=zyxw%>|<%=zyxw%>|<%=zyxw%>'
我想实现:图片1 图片2 图片3
连接1 链接2 链接3
文字1 文字2 文字3 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询