网上搜了几种办法

IE浏览器:在<object></object>标签内加入 <param name="wmode" value="transparent" /> 注:设置了并没有用。其他网友说是有用。

其他浏览器:在<embed /> 加入  <embed wmode=”opaque”></embed>

 

最终解决办法:

 <div id="contextmenu" style="width: 200px; height:220px;DISPLAY: none; top: 26px; left: 300px;z-index:999999">

     <Object>   .................     </Object>

  加入:  

    <iframe src="" frameBorder="0" marginHeight="0" marginWidth="0" style="position:absolute;visibility:inherit;top:0px;left:0px;width:200px;height:200px;
        z-index:-1;filter:alpha(opacity=0);"></iframe>
 </div>

    有几点需要注意:

  iframe级别大于Object,DIV可以遮盖住iframe

  1.div必须有特定的z-index且大于iframe的z-index,不能是auto或空。

  2.iframe的z-index必须为负(之前一直设置为正值,虽然小于div的z-index,但一直不能被div遮盖),否则,div无法遮盖iframe

  3.iframe的top和left为0,且iframe的宽、高与div的宽高相等。

  4.注意设置iframe的透明度为0.

posted on 2018-03-15 15:38  输入密码  阅读(2118)  评论(0编辑  收藏  举报