将任意flash对象wmode更改为透明 [英] Changing arbitrary flash objects wmode to transparent

查看:193
本文介绍了将任意flash对象wmode更改为透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将任意flash对象的 wmode 更改为透明的外部js文件,以确保它们不隐藏菜单而不使用Jquery或类似的库。



在FF中,我使用 getElementsByTagName(embed)并设置属性。看来工作得很好。



特别是我遇到 object swfObject 在IE7中。


$ b swfObject 在iE7中创建以下代码: p>

 < OBJECT id = mymovie height = 400 width = 134 classid = clsid:D27CDB6E-AE6D-11cf-96B8-444553540000> 
< PARAM NAME =_ cxVALUE =3545>
< PARAM NAME =_ cyVALUE =10583>
< PARAM NAME =FlashVarsVALUE =>
< PARAM NAME =MovieVALUE =imgs / site / tower.swf>
< PARAM NAME =SrcVALUE =imgs / site / tower.swf>
< PARAM NAME =WModeVALUE =Window>
< PARAM NAME =PlayVALUE =0>
< PARAM NAME =LoopVALUE = - 1>
< PARAM NAME =质量VALUE =高>
< PARAM NAME =SAlignVALUE =>
< PARAM NAME =MenuVALUE = - 1>
< PARAM NAME =BaseVALUE =>
< PARAM NAME =AllowScriptAccessVALUE =>
< PARAM NAME =ScaleVALUE =ShowAll>
< PARAM NAME =DeviceFontVALUE =0>
< PARAM NAME =EmbedMovieVALUE =0>
< PARAM NAME =BGColorVALUE =FFFFFF>
< PARAM NAME =SWRemoteVALUE =>
< PARAM NAME =MovieDataVALUE =>
< PARAM NAME =SeamlessTabbingVALUE =1>
< PARAM NAME =ProfileVALUE =0>
< PARAM NAME =ProfileAddressVALUE =>
< PARAM NAME =ProfilePortVALUE =0>
< PARAM NAME =AllowNetworkingVALUE =all>
< PARAM NAME =AllowFullScreenVALUE =false>
< / OBJECT>

我尽可能的设置 wmode 透明,使闪光不隐藏浮动物体,包括但不限于:


  1. 搜索 OBJECT 并更改它的 PARAM wmode 透明

  2. 设定对象的属性(
  3. 调用对象 SetValue code> function

没有一个可以工作。尽管wmode似乎改变了Flash,但仍然隐藏了高 z-index 的其他对象。我在这里错过了什么?

解决方案



  $(embed)。attr(wmode,opaque)。wrap('< div>); 

它有效地重绘了flash对象,为我工作。

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.

In FF I use getElementsByTagName("embed") and set attribute. It seems to work well.

Specifically I'm having trouble with object set by swfObject library In 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>

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:

  1. Search for OBJECT and change its PARAM wmode to transparent.
  2. Set attribute of Object (wmode=transparent)
  3. Call the object's SetValue function

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>');

It effectively redraws the flash object, worked for me.

这篇关于将任意flash对象wmode更改为透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆