变换显示数据库图片(2/3)

<!--
FLASH样式
本例可以设置TOP的数字,从而可以动态控制图象的数量
 -->
<!--#include file="inc/conn.asp"-->
<%Set rs=Server.CreateObject("ADODB.Recordset")
sql="select top 5 * from product  where elite=true order by updatetime desc"
rs.open sql,conn,1,1%>
<DIV style="DISPLAY: none">
<TABLE id=pictable cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <%do while not rs.eof
    %>
  <TR>
 
    <TD><%=rs("bookpic")%></TD>
    <TD><%=rs("product_id")%></TD>
    <TD>productshow.asp?articleid=<%=rs("articleid")%></TD></TR>
  <%rs.movenext
  Loop
  rs.close%>
  </TBODY></TABLE></DIV>
<SCRIPT type=text/javascript>
 <!--
 
 var focus_width=550;//图象的宽度
 var focus_height=145;//图象的高度
 var text_height=25;//文字高度
 var swf_height = focus_height+text_height;
 var t=document.getElementById("pictable");
 var rl=t.rows.length;
 var baseu= document.URL.replace(/(http.*//)(.*)/, "$1");
 var pics=""; var links=""; var texts="";
 for (var i=0;i<rl;i++) {
  pics+=baseu+t.rows[i].cells[0].innerText.replace(///.*///, "")+"|";
  links+=t.rows[i].cells[2].innerText+"|";
  texts+=t.rows[i].cells[1].innerText+"|";
 }
 pics=pics.substr(0,pics.length-1);
 links=links.substr(0,links.length-1);
 texts=texts.substr(0,texts.length-1);
 var fv="pics="+pics+"&links="+links+"&texts="+texts+"&borderwidth="+focus_width+"&borderheight="+focus_height+"&textheight="+text_height;
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+focus_width+'" height="'+swf_height+'">');
 document.write('<param name="movie" value="test/pv.swf"> <param name="quality" value="high"><param name="allowScriptAccess" value="sameDomain"><param name="menu" value="false"><param name="bgcolor" value="#ffffff"><param name="wmode" value="opaque">');
 document.write('<param name="flashvars" value="'+fv+'"></object>');


 //-->
 </SCRIPT>

 Pv.swf需要的发邮件给我,或者在这里留言.

原文地址:https://www.cnblogs.com/zerogo/p/2209393.html