ASP實(shí)現(xiàn)js圖片的輪顯_ASP教程
推薦:ASP代碼直接增加、刪除ACCESS表和字段本例主要講述如何應(yīng)用Create、Drop和Alter語句增加、刪除ACCESS表和字段,代碼如下: % '''''''''''''''''''''''''''''''''''' ' 增加、刪除表和字段 ' ├Create Table 表名(field1 type[(size)] [null|not null] [default eExpression] [primary key][,fiel
下午做了一個(gè)asp+js實(shí)現(xiàn)圖片的輪顯的效果,效果圖如: 左側(cè)的圖片輪顯,在 我用的是js,然后我改了一下用asp實(shí)現(xiàn)效果的。
pic.asp源代碼:
<%
'連接數(shù)據(jù)庫代碼省去了
sql=("select * from Pic order by picorder asc,id desc")
Set rs=server.CreateObject("adodb.recordset")
If rs.eof And rs.bof Then
%>
document.write('暫無圖片');
<%
Else
%>
var focus_width=820
var focus_height=185
var text_height=0
var swf_height = focus_height+text_height
<%
'轉(zhuǎn)載請保留來源
Do While Not rs.eof
pics=pics&rs("picurl")&"|" '把圖片用"|"連接起來
links=links&rs("picaddress")&"|"
rs.movenext
Loop
picLen=Len(pics)
pics=Left(pics,(picLen-1)) '作用是去除最后一個(gè)"|"
linksLen=Len(links)
links=Left(links,(linksLen-1))
%>
var pics='<%=pics%>'
var links='<%=links%>'
var texts=''
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="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="flash/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
<%End If %>
然后在首頁調(diào)用的地方,<script type="text/javascript" src="pic.asp"></script>
pixviewer.swf 可以在 /flash/pixviewer.swf 下載。
作者:無情 出處:
分享:ASP技巧:rs.getrows方法GetRows()方法是將數(shù)據(jù)從 Recordset 復(fù)制到二維數(shù)組中,這是一個(gè)二維數(shù)組,第一個(gè)下標(biāo)標(biāo)識字段,第二個(gè)則標(biāo)識記錄號 所以rsArray = rs.GetRows() rsArray(0, 0)就表示記錄集第一行的第一字段值 rsArray(1, 0)就表示記錄集第一行的第二字段值 數(shù)組的數(shù)據(jù)是保
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-ASP實(shí)現(xiàn)js圖片的輪顯
。