ie flash透明 火狐不透明

今天同事做网站时无意中发现在ie下透明的flash在firefox下却不透明了
于是在网上查了一下发现
在ie中加这样一句代码<param name="wmode" value="transparent">就可以了
但是这句代码在firefox中不兼容,在Mozilla,Firefox浏览器中起作用的是这个标签
<embed></embed>
在<embed>标签内加入属性 wmode="transparent" 就可以实现flash背景透明,如
<embed src="iefirefox.swf" wmode="transparent" quality="high"></embed>

我是通过flash.js 调用的 flash文件
所以修改文件修改这个flash.js把里面的

function playswf(sFile,sWidth,sHeight){
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="'+ sHeight +'">  ');
		document.write('<param name="movie" value="'+ sFile +'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#000000" />');
//		document.write('<param name="SCALE" value="noborder" />');
		document.write('<param name="menu" value="false" />');
		document.write('<param name="wmode" value="transparent">'); //opaque transparent
		document.write('<embed src="'+ sFile +'" wmode="opaque" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="'+ sHeight +'"></embed>  ');
		document.write('</object>');
	}

修改成

	function playswf(sFile,sWidth,sHeight){
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="'+ sHeight +'">  ');
		document.write('<param name="movie" value="'+ sFile +'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#000000" />');
//		document.write('<param name="SCALE" value="noborder" />');
		document.write('<param name="menu" value="false" />');
		document.write('<param name="wmode" value="transparent">'); //opaque transparent
		document.write('<embed src="'+ sFile +'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="'+ sHeight +'"></embed>  ');
		document.write('</object>');
	}
wmode="opaque" 改成 wmode="transparent"

你可能感兴趣的:(IE,flash透明,火狐不透明)