-----------------------------------------------------------效果圖-----------------------------------------------------------
-------------------------------------------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