一段JS代码 IE能运行,FIREFOX不行,高手帮看下。。

七对 2009-12-01 11:53:14

// JScript 文件

var focus_width=822;
var focus_height=89;
var text_height=0;
var swf_height = focus_height+text_height;
var pics;
var links;
var texts;
var pics="img/index/banner/b1.jpg|img/index/banner/b2.jpg";
var links="#|#";
var texts="1|2";
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="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="img/index/banner/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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('</object>');



我是把这个写在一个JS里,然后在页面导入的。IE正常。火狐不行。高手赐教
...全文
158 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yinje2010 2009-12-30
  • 打赏
  • 举报
回复
楼上的做法是正确的,今天调整焦点图切换在火狐中发现有问题,采用楼上的方法解决了问题。
weddorn 2009-12-01
  • 打赏
  • 举报
回复
var focus_width=822;
var focus_height=89;
var text_height=0;
var swf_height = focus_height+text_height;
var pics;
var links;
var texts;
var pics="img/index/banner/b1.jpg|img/index/banner/b2.jpg";
var links="#|#";
var texts="1|2";
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="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="img/index/banner/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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 '
+'width="'+ focus_width +'"'
+'height="'+ swf_height +'"'
+'src="img/index/banner/focus.swf"'
+'allowScriptAccess="sameDomain"'
+'quality="high"'
+'bgcolor="#F0F0F0"'
+'menu="false"'
+'wmode="opaque"'
+'FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"'
+'>'
+'</embed>'
);


document.write('</object>');


加上红色部分 ff就兼容了
  • 打赏
  • 举报
回复
ff需要embed标签


var focus_width=822;
var focus_height=89;
var text_height=0;
var swf_height = focus_height+text_height;
var pics;
var links;
var texts;
var pics="img/index/banner/b1.jpg|img/index/banner/b2.jpg";
var links="#|#";
var texts="1|2";
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="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="img/index/banner/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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="img/index/banner/focus.swf" width="'+focus_width+'" height="'+swf_height+'">');//======
document.write('</object>');

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧