IE-8 iframe和flash对象忽略z索引?

IE-8 iframe和flash对象忽略z索引?,flash,iframe,internet-explorer-8,z-index,swfobject,Flash,Iframe,Internet Explorer 8,Z Index,Swfobject,我有下面的div,我正在尝试在我的_flash前面创建iframe层。 这是一个常见的问题,我已经通读了所有我能找到的解决方案,但我仍然在IE8中遇到问题。顺便说一下,我正在使用SWFobject 以下是消息来源: <script type="text/javascript"> swfobject.embedSWF("index.swf", "my_flash", "100%", "100%", "8.0.0"); swffit.fit("my_flash",900,650); &l

我有下面的div,我正在尝试在我的_flash前面创建iframe层。 这是一个常见的问题,我已经通读了所有我能找到的解决方案,但我仍然在IE8中遇到问题。顺便说一下,我正在使用SWFobject

以下是消息来源:

<script type="text/javascript">
swfobject.embedSWF("index.swf", "my_flash", "100%", "100%", "8.0.0");
swffit.fit("my_flash",900,650);
</script>

<div id="my_flash" style="z-index:1;"></div>

<div  style="border:none; overflow:hidden; width:50px; height:21px; z-index:9999; position: absolute; bottom: 5px; left: 110px;" >
<iframe src="http://www.facebook.com/plugins/like.php?blah.html" scrolling="no" frameborder="0" allowTransparency="true"  style="z-index:9998"/>
</div>

swfobject.embeddeswf(“index.swf”、“my_flash”、“100%”、“100%”、“8.0.0”);
swffit.fit(“我的闪光”,900650);

嵌入SWFOObject时,应设置Flash对象的wmode参数

这是一个简短的教程

以下是针对您的问题修改的代码:

<script type="text/javascript">
  swfobject.embedSWF("index.swf", "my_flash", "100%", "100%", "8.0.0", null, { wmode: "transparent" });
  swffit.fit("my_flash",900,650);
</script>

embedSWF(“index.swf”、“my_flash”、“100%”、“100%””、“8.0.0”、null、{wmode:“transparent”});
swffit.fit(“我的闪光”,900650);

不幸的是,z索引不会影响Flash Player。参见此示例:(相关)

在上面链接的示例中,父元素有
位置:“relative”
,HTML元素有
位置:“absolute”
。SWF不需要指定
位置
。没有一个元素指定了
z-index
。SWF需要将
wmode
设置为
不透明
透明
wmode:“不透明”
wmode:“透明”
更可取,因为
透明
不透明
会引起问题并使用更多的处理能力

试试这个:

<style type="text/css"> 
/* establish relationship with child elements */
#wrapper { position: relative; }

/* this element will automatically appear overtop 
   of the wmode=opaque SWF without needing z-index */
#myiframe { position: absolute; }

/* No CSS needs to be specified for the SWF */
#myswf { }
</style>

<div id="wrapper"> 
    <iframe id="myiframe" src="mypage.html"></iframe> 
    <div id="myswf">This will be replaced by SWFObject</div> 
</div> 

/*与子元素建立关系*/
#包装器{位置:相对;}
/*此元素将自动显示在顶部
wmode的属性=不需要z索引的不透明SWF*/
#myiframe{位置:绝对;}
/*不需要为SWF指定CSS*/
#myswf{}
这将由SWFObject替换
var flashvars = {};
var params = {};
params.wmode = "transparent";
var attributes = {};

swfobject.embedSWF("index.swf", "my_flash", "100%", "100%", "8.0.0", '/swfobject/expressInstall.swf',
    flashvars, params, attributes);