最近使用Flex做了一个图片预览的功能,想要实现当检测所选图片有效性时在整个页面出现一个遮罩层(使用了Jquery的mask插件)以使用户不能再进行其它操作(尤其是提交表单的操作),顺着这个思路把代码写好后测试时发现在其它浏览器中都好用,可是在IE浏览器中就不好用——object标签区域遮罩层不好使,代码如下:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="tempPictureUpload" width="150" height="188" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="<%=basePath %>js/previewPicture/previewPicture.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="flashVars" value="saveTempPictureURL=<%=basePath %>" /> <embed name="tempPictureUpload" src="<%=basePath %>js/previewPicture/previewPicture.swf" quality="high" bgcolor="#869ca7" width="210" height="144" align="middle" play="true" loop="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashVars="saveTempPictureURL=<%=basePath %>SaveTempPictureServlet" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed> </object>通过网络终于找到了解决问题的方法——在object标签中添加<param name="wmode" value="transparent">即可,修改后的代码如下:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="tempPictureUpload" width="150" height="188" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="<%=basePath %>js/previewPicture/previewPicture.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="wmode" value="transparent"> <param name="flashVars" value="saveTempPictureURL=<%=basePath %>" /> <embed name="tempPictureUpload" src="<%=basePath %>js/previewPicture/previewPicture.swf" quality="high" bgcolor="#869ca7" width="210" height="144" align="middle" play="true" loop="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashVars="saveTempPictureURL=<%=basePath %>SaveTempPictureServlet" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed> </object>
原文地址:http://blog.csdn.net/gaohuanjie/article/details/41381413