1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

广告切换代码

本帖由 Ulysses2006-09-23 发布。版面名称:前端开发

  1. Ulysses

    Ulysses New Member

    注册:
    2006-02-05
    帖子:
    10,018
    赞:
    16
    PHP:
    <SCRIPT type=text/javascript>
     <!--
     
     var 
    focus_width=553;
     var 
    focus_height=176;
     var 
    text_height=0;
     var 
    swf_height focus_height+text_height;
     
     var 
    pics='http://www.21cn.gd.cn/upload/AdImg/August.jpg|http://www.21cn.gd.cn/upload/AdImg/index_mid_pic.jpg|http://www.21cn.gd.cn/upload/AdImg/corp_cx.jpg';
     var 
    links='http://www.21cn.gd.cn/ad/ad0904/index.htm|http://www.160it.net/ad/ad0714/index.htm|http://www.160it.net/ad/ad0521/index.htm';
     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="http://www.21cn.gd.cn/flash/playflash.swf"><param name=wmode value=transparent><param name="quality" value="high">');
     
    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="http://www.21cn.gd.cn/flash/playflash.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#DADADA" quality="high" width="'focus_width +'" height="'swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  document.write('</object>');
     
     
    //-->
     
    </SCRIPT>
    首先将 http://www.21cn.gd.cn/flash/playflash.swf 保存下来,然后对应修改 pics 和 links 以及 Flash 文件的路径即可。

    效果在 http://21cn.gd.cn/ 上有。