二级菜单被iframe遮住的处理方法
我们经常看到二级选单被flash或者iframe挡住,
此时设定再高的z-index也无效,
解决方法:
(1)通常使用iframe引用一个flash时是这样写的:
<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/lZqrG1bdGtg" frameborder="0" allowfullscreen></iframe>
为了不让它挡住二级菜单,就得这样写:
<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/lZqrG1bdGtg?wmode=opaque" frameborder="0" allowfullscreen></iframe>
(2)如果只是一个纯粹的flash,没有通过iframe来调用,则为了避免遮住二级菜单,在引用flash文件时,应注意加入以下两个元素:
<object width="280" height="189">
<param name="movie" value="http://www.youtube.com/v/GDFUdMvacI0?version=3&hl=en_US&rel=0"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="transparent"> </param>
<embed src="http://www.youtube.com/v/GDFUdMvacI0?version=3&hl=en_US&rel=0" type="application/x-shockwave-flash" width="280" height="189" allowscriptaccess="always" allowfullscreen="true" wmode="transparent"></embed>
</object>
小提示: 网络上众多高手提供的方法是 wmode="transparent",本人使用时,却是无效无解,倒是把"transparent"替换成"opaque",效果就出来了....希望这些对大家有帮助...
浙公网安备 33010602011771号