1、 html 元素遮挡 flash 详解示例代码如下:wmode 参数:transparent 模式:可用 z-index 控制层级opaque 模式:可用 z-index 控制层级window 模式: flash 层级在浏览器核心显示窗口之上,flash 会盖住与他重合的 html情景 1(可修改 flash 的 wmode 参数)修改 wmode 属性为,transparent 或 opaqueDEMO 如下:代码如下:!doctype htmlhtml lang=“en“headmeta charset=“UTF-8“title HTML 元素遮挡 Flash - 情景 1 /titles
2、tylehtml, body, object, embed padding: 0; margin: 0; .m-box position: relative; /p p .m-flash, .m-flash embed width: 400px; .m-shadow position: absolute; top: 0; left: 0; width: 100px; height: 100px; background-color: #ccc; /style/headbody!-transparent-div class=“m-box“object class=“m-flash“ classid
3、=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000“param name=“src“ value=“a href=“http:/ name=“wmode“ value=“transparent“/embed wmode=“transparent“ src=“a href=“http:/ p div class=“m-shadow“Jununx,欢迎您!-transparent/div/div/p p!-opaque-div class=“m-box“object class=“m-flash“ classid=“clsid:D27CDB6E-AE6D-11
4、cf-96B8-444553540000“param name=“src“ value=“a href=“http:/ name=“wmode“ value=“opaque“/embed wmode=“opaque“ src=“a href=“http:/ p div class=“m-shadow“Jununx,欢迎您!-opaque/div/div/p p/body/html情景 2(不可修改 flash 的 wmode 参数)- flash 和你的 iframe 遮挡层在同一个页面注:如果要兼容 Safari、Opera,那么请直接告诉需求这个遮不了 DEMO 如下:代码如下:!doct
5、ype htmlhtml lang=“en“headmeta charset=“UTF-8“title HTML 元素遮挡 Flash - 情景 2 /titlestylehtml, body, object, embed padding: 0; margin: 0; .m-box position: relative; /p p .m-flash, .m-flash embed width: 400px; .m-flash position: relative; z-index: 1; .m-shadow position: absolute; top: 0; left: 0; z-inde
6、x: 2; width: 100px; height: 100px; background-color: #ccc; .m-shadow-txt position: absolute; z-index: 2; .m-shadow-ifr position: absolute; z-index: -1; width: 100%; height: 100%; opacity: 0; filter: alpha(opacity=0); /style/headbody!-window-div class=“m-box“object class=“m-flash“ classid=“clsid:D27C
7、DB6E-AE6D-11cf-96B8-444553540000“param name=“src“ value=“a href=“http:/ name=“wmode“ value=“window“/embed wmode=“window“ src=“a href=“http:/ p div class=“m-shadow“div class=“m-shadow-txt“Jununx,欢迎您!-window/diviframe class=“m-shadow-ifr“ frameborder=“0“/iframe/div/div/p p/body/html情景 3(不可修改 flash 的 w
8、mode 参数)- flash 是被一个 iframe 页面引入的注:如果木有权限操作 iframe 页面,那么请直接告诉需求这个遮不了注:如果要兼容Safari、Opera,那么请直接告诉需求这个遮不了DEMO 页:代码如下:!doctype htmlhtml lang=“en“headmeta charset=“UTF-8“title HTML 元素遮挡 Flash - 情景 2 /titlestylehtml, body, object, embed padding: 0; margin: 0; .m-box position: relative; /p p .m-flash posit
9、ion: relative; width: 400px; height: 400px; z-index: 1; .m-shadow position: absolute; top: 0; left: 0; z-index: 2; width: 100px; height: 100px; background-color: #ccc; .m-shadow-txt position: absolute; z-index: 2; .m-shadow-ifr position: absolute; z-index: -1; width: 100%; height: 100%; opacity: 0;
10、filter: alpha(opacity=0); /style/headbody!-window-div class=“m-box“iframe class=“m-flash“ src=“ifr.html“ frameborder=“0“/iframe/p p div class=“m-shadow“div class=“m-shadow-txt“Jununx,欢迎您!-window/diviframe class=“m-shadow-ifr“ frameborder=“0“/iframe/div/div/p p/body/htmliframe 页:代码如下:!doctype htmlhtm
11、l lang=“en“headmeta charset=“UTF-8“title HTML 元素遮挡 Flash - 情景 3 /titlestylehtml, body, object, embed padding: 0; margin: 0; .ifr position: absolute; z-index: 2; width: 100px; height: 100px; opacity: 0; filter: alpha(opacity=0); .m-flash position: absolute; z-index: 1; width: 400px; /style/headbody!-window-object class=“m-flash“ classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000“param name=“src“ value=“a href=“http:/ name=“wmode“ value=“window“/embed wmode=“window“ src=“a href=“http:/ piframe class=“ifr“ frameborder=“0“/iframe/body/html详细出处参考:http:/