[英]Embedding swf into html page
我找到了一些将 swf 嵌入 html 页面的方法......这是代码......
<object id="swfobj" style="display:none; margin-right: 385px;" classid="clsid:D27CDB6E- AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="309" height="200">
<param name="movie">
<param name="quality" value="high">
<embed style="margin-left: 18px;border:1px solid #999999;" quality="high" width="309" height="200" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
然后在 JavaScript 部分我有这个
function openfile(filePath) {
$("#swfobj > EMBED").attr("src", filePath);
$("#swfobj").fadeIn("slow");
};
现在我有两个问题
1.此代码在 Firefox 中有效,但在 Chrome 中崩溃...仅当我单击第一个元素然后停止工作时才有效...如何制作此跨浏览器?
2.我想在浏览器的新标签页中打开 swf... 我该怎么做?
在您的 function 中添加:
my_window = window.open("myflash.html", "mywindow1", "status=1,width=309,height=200");
my_window.document.write($("#swfobj").html());
This will open a new window (myflash.html, you must create it) that contains the html of object
with id #swfobj
.
请记住,您必须使#swfobj
在新的 window 中可见。 所以添加
swfobj {
display:block !important;
}
在 myflash.html 中(需要!important
来覆盖内联display:none
#swfobj
以上适用于 firefox 和 chrome,但您必须启用弹出窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.