今天在写一个flash广告代码的时候,因为flash自带的链接,容易被当成弹出广告,所以做了一个div层放到flash上面,这样链接都是a触发的不会被拦截,但发现flash一直处于div层上面,原来flash需要加个参数才可以。 让flash置于DIV层之下的方法,让flash不挡住飘浮层或下拉菜单,让Flash不档住浮动对象或层的关键参数:wmode=opaque。 方法如下: 针对IE 在内加上参数 针对FF 在内加上参数wmode="opaque" 脚本之家使用代码: XML/HTML Code复制内容到剪贴板 22cn <br /><!-- <br />body { <br />position:relative; <br />z-index:0; <br />margin:0; padding:0 <br />} <br />body,td,th { <br /> color: #333333; <br />} <br />*{margin:0; padding:0} <br />img{ border:0} <br />#jb51{ position:relative; width:300px; height:250px} <br />#div1 { <br />position:absolute; <br />left:0; <br />top:0; <br />width:300px; <br />height:250px; z-index:-1 <br /> <br />} <br />#div2 { <br />position:absolute; <br />left:0; <br />top:0; <br />width:300px; <br />height:250px; <br />z-index:99999; <br />} <br />--> <br /> <br />document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="300" height="250">'); <br />document.write('<param name="movie" value="http://img.jb51.net/image/22cn_jb51net.swf" />'); <br />document.write('<param name="quality" value="high" /><param name="wmode" value="opaque" />'); <br />document.write('<embed src="http://img.jb51.net/image/22cn_jb51net.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="250" wmode="opaque">'); <br />document.write(''); <br />