-----------------------------------------------------------效果图-----------------------------------------------------------
-------------------------------------------js程序代码newpicsshow.js开始-------------------------------------------
//pics为图片列表,links为链接列表,texts为标题列表,width为图片宽度,height为图片高度
function shownewspic(pics,links,texts,width,height) {
var focus_width = 310;
if(typeof(width) != "undefined") {
focus_width=width;
}
var focus_height=225;
if(typeof(height)!="undefined") {
focus_height=height;
}
var text_height=25; //text_height为标题高度,当高度为0时,不显示标题
var swf_height = focus_height+text_height;
//注意下面调用的pixviewer.swf一定要存储到本地
document.write('<object classid="clsid:D27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="js/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
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="js/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#000000" 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>');
}
-------------------------------------------js程序代码newpicsshow.js结束-------------------------------------------
-------------------------------------------------------前台调用的部分-----------------------------------------------------
var pics='img/new01.jpg|img/new02.jpg|img/new03.jpg|img/new04.jpg';
var links='#|http://#|http://#|http://#';
var texts='图片标题图片标题|图片标题图片标题|图片标题图片标题|图片标题图片标题';
shownewspic(pics,links,texts,282,172);
附:下载图片并改名为pixviewer.swf