日期:2014-05-17  浏览次数:20878 次

csdn首页的图片广告轮换是怎么做的?
csdn首页的图片广告轮换幻灯片(图片下面有1,2,3,4,5,6张图可以变换)是怎么做的?谁能提供代码?谢谢!

------解决方案--------------------
我的blog里面有,呵呵,这里给一个例子
<!--
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>


------解决方案--------------------
<script type= "text/javascript ">
imgUrl1= "images/youyn1.jpg ";
imgtext1= "云南海外旅游总公司 "
imgLink1=escape( "http://www.youyn.net/us.asp ");
imgUrl2= " images/youyn2.jpg ";
imgtext2= "精彩云南旅游 "
imgLink2=escape( "http://www.youyn.net/travelline.asp?un_type=1 ");
imgUrl3= " images/youyn3.jpg ";
imgtext3= "中国 魅力无限 "
imgLink3=escape( "http://www.youyn.net/travelline.asp?un_type=2 ");
imgUrl4= " images/youyn4.jpg ";
imgtext4= "海外带你游