js幻灯片代码显示不出图片
[code=JScript][/code]
<script language="javascript">
linkarr = new Array();
picarr = new Array();
textarr = new Array();
var swf_width=294;
var swf_height=221;
var files = "";
var links = "";
var texts = "";
//这里设置调用标记
linkarr[1] = "#";
picarr[1] = "/image/f1.jpg";
//textarr[1] = "皮肤病症状之过敏症状处理";
linkarr[2] = "#";
picarr[2] = "/image/f1.jpg";
//textarr[2] = "常见的皮肤过敏症状有哪些?";
linkarr[3] = "#";
picarr[3] = "/image/f1.jpg";
//textarr[3] = "牛皮癣治疗方法有哪些误区";
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="/image/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+'">');
document.write('<embed src="/image/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>
------解决方案--------------------
把所有的/image替换为image,测试通过能正常显示
------解决方案--------------------
确保bcastr3.swf在你的image文件夹下
另外,你注释 掉了textarr数组的赋值语句,那么
for(i=1;i<textarr.length;i++){
if(texts=="") texts = textarr[i];
else texts += "|"+textarr[i];
}
应该是没有执行。
下面传参数字符串是需要"|文字|文字|文字"形式,
你看问题是不是出在这里!!!