将任意 Flash 对象 wmode 更改为透明 [英] Changing arbitrary flash objects wmode to transparent
问题描述
我需要将任意 Flash 对象的 wmode
更改为从外部 js 文件透明,以确保它们在不使用 Jquery 或类似库的情况下不会隐藏菜单.
I need to change wmode
of arbitrary flash objects to transparent from external js file to make sure they don't hide menus without using Jquery or similar libs.
在 FF 中,我使用 getElementsByTagName("embed")
并设置属性.看起来效果不错.
In FF I use getElementsByTagName("embed")
and set attribute. It seems to work well.
特别是我在使用 IE7 中的 swfObject
库设置的 object
时遇到了问题.
Specifically I'm having trouble with object
set by swfObject
library In IE7.
swfObject
在 iE7 中创建以下代码:
swfObject
creates the following code in iE7:
<OBJECT id=mymovie height=400 width=134 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>
<PARAM NAME="_cx" VALUE="3545">
<PARAM NAME="_cy" VALUE="10583">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="imgs/site/tower.swf">
<PARAM NAME="Src" VALUE="imgs/site/tower.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="0">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="FFFFFF">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
</OBJECT>
我尝试了各种可能的方法将 wmode
设置为 transparent
并使 flash 不隐藏浮动对象而没有成功,包括但不限于:
I tried every possible way to set wmode
to transparent
and make the flash not hide floating objects without success including but not limited to:
- 搜索
OBJECT
并将其PARAM
wmode
更改为transparent
. - 设置
Object
的属性(wmode=transparent
) - 调用
object
的SetValue
函数
- Search for
OBJECT
and change itsPARAM
wmode
totransparent
. - Set attribute of
Object
(wmode=transparent
) - Call the
object
'sSetValue
function
似乎都不起作用.虽然 wmode 似乎改变了 Flash 仍然隐藏了高 z-index
的其他对象.我在这里错过了什么?
None seems to work. Although the wmode seems to change Flash still hides other objects with high z-index
. What am I missing here?
推荐答案
我用这个小技巧成功了:
I've been successful with this little trick:
$("embed").attr("wmode", "opaque").wrap('<div>');
它有效地重绘了 Flash 对象,对我有用.
It effectively redraws the flash object, worked for me.
这篇关于将任意 Flash 对象 wmode 更改为透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!