收藏本站 织梦模板之家(Mubanzhijia.Com),专注织梦模板设计制作!

热门搜索:

当前位置:主页 > 网站教程 > 技术教程 >

dedecms织梦幻灯片基本用法详解

时间:2014-04-01 来源:互联网 作者:模板之家 阅读:

织梦幻灯片标题+标题背景+分页组成,很多朋友的织梦网站幻灯片想要看起来漂亮,例如织梦官网幻灯片:

dedecms织梦幻灯片基本用法详解

然后我们查看一下它的源码:

<!-- size: 682px * 240px -->   

<scriptlanguage='javascript'>   

linkarr = new Array();   

picarr = new Array();   

textarr = new Array();   

var swf_width=682;   

var swf_height=240;   

var files = "";   

var links = "";   

var texts = "";   

//这里设置调用标记   

linkarr[1] = "/plus/view.php?aid=1099";   

picarr[1] = "http://www.dedecms.com/products/education/edupic.gif";   

linkarr[2] = "/plus/view.php?aid=1091";   

picarr[2] = "http://www.dedecms.com/img/adimg/dedev56.jpg";   

linkarr[3] = "/blog/2009/0929/1026.html";   

picarr[3] = "/uploads/allimg/090929/1-0Z9291622310-L.jpg";   

linkarr[4] = "/news/me/2009/0929/1018.html";   

picarr[4] = "/uploads/allimg/090929/1-0Z929152P00-L.jpg";   


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="/templets/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="/templets/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>

这段代码看起来复杂,其实很简单,所以下面详细解读一下织梦幻灯片的做法:

织梦官方幻灯片代码解读:

<script language='javascript'>

linkarr = new Array();

picarr = new Array();

textarr = new Array();

//幻灯片大小,这里我们也可以修改幻灯片得长度 和 宽度 

var swf_width=280;

var swf_height=192;

//下面可以修改文字颜色|文字位置|文字背景颜色|文字背景透明度|按键文字颜色|按键默认颜色|按键当前颜色|自动播放时间|图片过渡效果|是否显示按钮|打开方式

var configtg='0xffffff|0|0x3FA61F|5|0xffffff|0xC5DDBC|0x000033|2|3|1|_blank';

var files = "";

var links = "";

var texts = "";

//这里设置调用标记row代表调用的图片数量

{dede:arclist flag='f' row='5'}

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 /}/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_title='+texts+'&bcastr_config='+configtg+'">');


document.write('<embed src="{dede:global.cfg_templeturl /}/default/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|0|0x3FA61F|5|0xffffff|0xC5DDBC|0x000033|2|3|1|_blank';

修改成

var configtg='0xffffff||0x3FA61F|5|0xffffff|0xC5DDBC|0x000033|2|3|1|_blank';

还要把 DEDECMS模板

textarr[[field:global.autoindex/]] = "[field:title function='html2text(@me)'/]";

for(i=1;i<textarr.length;i++){

if(texts=="") texts = textarr[i];

else texts += "|"+textarr[i];

}

删除即可。

最后,再在织梦网站后台核心里面找到栏目管理,进行添加有幻灯属性的带图片的文档即可!

然后保存,一键更新网站即可。就这样一个简单的动作就让你的网站显得更漂亮,更美观了。

本文版权归原作者所有,转载请注明原文来源出处,织梦模板之家感谢您的支持!

本文链接:http://www.mubanzhijia.com/jishujiaocheng/367.htmldedecms织梦幻灯片基本用法详解http://www.mubanzhijia.com/jishujiaocheng/367.html

相关内容:
发表评论:
特价模板
特价织梦模板本站将持续推出,特价模板不参与其他促销活动!