flash在div overflow hidden的显示问题

by Weijie JIN on

昨天在做项目的时候,要用到一个别的网站的flash(同一家公司的两个网站,所以没有版权问题)。拿到flash的时候,发现这个flash的底部有一条白边:

image

准备用一个div把这个flash object 包起来,然后设定高度和overflow:hidden把这个白边隐藏掉,在ie下可以,但在firefox下flash会穿越div。
经过一番搜索,找到原因,其实很简单,只要在embed tag上加个属性wmode="transparent" 就解决了,wmode是什么意思呢?官方文档上是这么写的:

  • wmode – Possible values: window, opaque, transparent. Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser.
    • window – movie plays in its own rectangular window on a web page.
    • opaque – the movie hides everything on the page behind it.
    • transparent – the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance.

关于flash的所有参数,可以参阅:http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
最后,flash显示效果:

image

Previous post:

Next post: