網上搜了幾種辦法
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.