章丘做网站之dedecms技巧

2015-9-12 19:42:50      点击:
织梦是大家比较熟悉的一个cms网站程序了,很多人制作网站的时候,往往不知道幻灯片是如何调用的。下面章丘做网站给大家贴出来幻灯片的代码,希望对大家有用。

幻灯片调用:
<div style="width: 1004px; height: 380px;">
              <script language='javascript'>
linkarr = new Array();
picarr = new Array();
textarr = new Array();
var swf_width=1004;
var swf_height=380;
var files = "";
var links = "";
var texts = "";
//这里设置调用标记
{dede:arclist flag='f' row='15' typeid='1'}
linkarr[[field:global.autoindex/]] = "[field:arcurl/]";
picarr[[field:global.autoindex/]]  = "[field:litpic/]";

{/dede:arclist}
 
for(i=1;i<picarr.length;i++){
  if(files=="") files = picarr[i];
  else files += "|"+picarr[i];
}
for(i=1;i<linkarr.length;i++){
  if(links=="") links = linkarr[i];
  else links += "|"+linkarr[i];
}
for(i=1;i<textarr.length;i++){
  if(texts=="") texts = textarr[i];
  else texts += "|"+textarr[i];
}
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="{dede:global.cfg_templeturl /}/default/images/bcastr3.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_file='+files+'&bcastr_link='+links+'&bcastr_config=0xffffff|2|0x8CA2AD|60|0xffffff|0xff9900|0x000033|2|3|1|_blank">');  
document.write('<embed src="{dede:global.cfg_templeturl /}/default/images/bcastr3.swf" wmode="opaque" FlashVars="bcastr_file='+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>
            </div>

width: 1004px; height: 380px修改为相对应的flash大小即可
第二种:
    <script language='javascript'>
    linkarr = new Array();
    picarr = new Array();
    textarr = new Array();
    var swf_width=300;
    var swf_height=200;
    var configtg="0xffffff:文字颜色|2:文字位置|0x000000:文字背景颜色|30:文字背景透明度|0xffffff:按键文字颜色|0x4f6898:按键默认颜色|0x000033:按键当前颜色|8:自动播放时间|3:图片过渡效果|1:是否显示按钮|_blank:打开新窗口";
    var files = "";
    var links = "";
    var texts = "";
    //这里设置调用标记
    {dede:arclist flag='f' row='10' typeid="all"}
    linkarr[[field:global.autoindex/]] = "[field:arcurl/]";
    picarr[[field:global.autoindex/]] = "[field:litpic/]";
    textarr[[field:global.autoindex/]] = "[field:title function='html2text(@me)'/]";
    {/dede:arclist}
    for(i=1;i<picarr.length;i++){
    if(files=="") files = picarr[i];
    else files += "|"+picarr[i];
    }
    for(i=1;i<linkarr.length;i++){
    if(links=="") links = linkarr[i];
    else links += "|"+linkarr[i];
    }
    for(i=1;i<textarr.length;i++){
    if(texts=="") texts = textarr[i];
    else texts += "|"+textarr[i];
    }
    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="{dede:global.cfg_templeturl /}/images/bcastr3.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_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&bcastr_config='+configtg+'">');
    document.write('<embed src="{dede:global.cfg_templeturl /}/images/bcastr3.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&bcastr_config='+configtg+'&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>


自己更改var configtg="0xffffff:文字颜色|2:文字位置|0x000000:文字背景颜色|30:文字背景透明度|0xffffff:按键文字颜 色|0x4f6898:按键默认颜色|0x000033:按键当前颜色|8:自动播放时间|3:图片过渡效果|1:是否显示按钮|_blank:打开新窗 口";