flash挡住了页面其它部分怎么办

2009-06-14 22:52  Read:

在网页制作中往往会加入一些FLASH以提高页面动感,或是加入广告时加入了FLASH条。但往往发现它总在页面其它部分的上层,比如“下拉菜单”,我在查询了很多资料后也做了很多测试总结几个办法如下:

首先要对FLASH在页面中的代码部分进行修改,有两处:

1、加入这一行: <param name="wmode" value="transparent" />

2、加入红色的部分: <embed src="YourFlash.swf" wmode="transparent" ... ></embed>

通过以上办法基本上已经解决了这个问题,但如果我们想在FLASH上面加一个层,并且层内有透明的PNG图片怎么办?这么做的用意就是让PNG的透明+FLASH的动作,制作出更丰富的效果,问题来了~!我总结了下面的办法,基本上在IE7、IE6、FF中效果都OK!

首先定义一个DIV将FLASH放制其中,完后在此DIV后面再加一个DIV,并加入以下样式:

 #mypng {
 background:url(images/1.png);
 height:200px;
 width:200px;
 margin-top:-200px;
 position:absolute;
 }
 * html #mypng{
 background:url("images/1.png") no-repeat left !important;
 background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/1.png',sizingMethod='image');
 height:200px;
 width:200px;
 margin-top:-200px;
 position:absolute;
 } /* IE6 */

* html #mypng 是专指给IE6去使用的,为的是让PNG底图在IE6中为透明,当然了,PNG图片的尺寸一定要与此DIV的高宽一样,因为这种底图在IE6中是不会循环的(很费解昂~~)

OK!至此全部搞定,页面代码参考:

 <div id="topflash">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="980" height="396">
    <param name="movie" value="images/YourFlash.swf" />
    <param name="wmode" value="transparent" />
    <param name="quality" value="high" />
    <embed src="images/YourFlash.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="980" height="396"></embed>
  </object>
</div>

<div id="mypng"></div>

用户名: 密码:
匿名发表
全部评论:0