最近一个小站的首页幻灯片出现了问题,为了修正这个错误,特找一个比较的好看的风格,改了一下。现在发出来和大家一起交流。
演示效果:http://tkd.lyduo.com/
代码如下:
- <script language=javascript>
- //-------定义图片路径等参数-------------//
- //定义大图的路径,
- {dede:arclist flag='f' row='1' limit='0,1' }
- var bigPic0 ="[field:litpic/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='1,1'}
- var bigPic1 ="[field:litpic/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='2,1'}
- var bigPic2 ="[field:litpic/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='3,1'}
- var bigPic3 ="[field:litpic/]";
- {/dede:arclist}
- //小图路径
- {dede:arclist flag='f' row='1' limit='0,1'}
- var smallPic0 ="[field:litpic/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='1,1'}
- var smallPic1 ="[field:litpic/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='2,1'}
- var smallPic2 ="[field:litpic/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='3,1'}
- var smallPic3 ="[field:litpic/]";
- {/dede:arclist}
- //大图的点击后的URL
- {dede:arclist flag='f' row='1' limit='0,1'}
- var PicURL0 ="[field:arcurl/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='1,1'}
- var PicURL1 ="[field:arcurl/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='2,1'}
- var PicURL2 ="[field:arcurl/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='3,1'}
- var PicURL3 ="[field:arcurl/]";
- {/dede:arclist}
- //标题
- {dede:arclist flag='f' row='1' titlelen=50 limit='0,1'}
- var t0="[field:title/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' titlelen=50 limit='1,1'}
- var t1="[field:title/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' titlelen=50 limit='2,1'}
- var t2="[field:title/]";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' titlelen=50 limit='3,1'}
- var t3="[field:title/]";
- {/dede:arclist}
- //描述
- {dede:arclist flag='f' row='1' limit='0,1'}
- var describe0="[field:description function="cn_substr(@me,80)"/] ";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='1,1'}
- var describe1="[field:description function="cn_substr(@me,80)"/] ";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='2,1'}
- var describe2="[field:description function="cn_substr(@me,80)"/] ";
- {/dede:arclist}
- {dede:arclist flag='f' row='1' limit='3,1'}
- var describe3="[field:description function="cn_substr(@me,80)"/] ";
- {/dede:arclist}
- //
- var t=t0+"[|]"+t1+"[|]"+t2+"[|]"+t3;
- var bigPicURL=bigPic0+"[|]"+bigPic1+"[|]"+bigPic2+"[|]"+bigPic3;
- var smallPicURL=smallPic0+"[|]"+smallPic1+"[|]"+smallPic2+"[|]"+smallPic3;
- var PicURL=PicURL0+"[|]"+PicURL1+"[|]"+PicURL2+"[|]"+PicURL3;
- var describe = describe0+"[|]"+describe1+"[|]"+describe2+"[|]"+describe3;
- //
- document.write("\
- <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='535' height='356' ID=FSCommand NAME='focus_one' align='middle'>\
- <param name='allowScriptAccess' value='sameDomain' />\
- <param name='movie' value='bnfocus.swf' />\
- <param name='FlashVars' value='bigPicURL=" + bigPicURL + "&smallPicURL=" + smallPicURL + "&t="+t+"&PicURL="+PicURL+"&describe="+describe+"'/>\
- <param name='quality' value='high' />\
- <param name='bgcolor' value='#ffffff' />\
- <embed src='bnfocus.swf' FlashVars='bigPicURL=" + bigPicURL + "&smallPicURL=" + smallPicURL + "&t="+t+"&PicURL="+PicURL+"&describe="+describe+"' quality='high' bgcolor='#ffffff' width='535' height='356' name='focus' swLiveConnect='true' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
- </object>\
- ");
- </script>
幻灯片 :bnfocus.rar 需要注册官方论坛的ID ,否则下载不了哦! |