2009-10-14 48 views

Trả lời

13

Nó không phải là tiêu chuẩn tương thích, nhưng hãy thử thêm wmode="transparent" cho thẻ embed như sau:

<object> 
    <!-- ... --> 
    <param name="wmode" value="transparent"/> 
    <embed src="flash_file.swf" wmode="transparent"></embed> 
    <!-- ... --> 
</object> 

Với những thông số thiết lập, bộ phim flash nên vâng phục các thiết lập CSS z-index.

2

Về cơ bản câu trả lời của Mike Koval sẽ thực hiện công việc, đó là thiết lập wmode="transparent". Tất cả các HTML/CSS/JS khác sẽ vẫn giữ nguyên từ your own link.

Full nhúng phiên bản mã HTML (bởi swfObject's generator) sẽ là:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent"> 
     <param name="movie" value="path/to/flash.swf" /> 
     <param name="wmode" value="transparent" /> 
     <!--[if !IE]>--> 
     <object type="application/x-shockwave-flash" data="path/to/flash.swf" width="800" height="600"> 
      <param name="wmode" value="transparent" /> 
     <!--<![endif]--> 
      <a href="http://www.adobe.com/go/getflashplayer"> 
       <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> 
      </a> 
     <!--[if !IE]>--> 
     </object> 
     <!--<![endif]--> 
</object> 

Nó sẽ luôn luôn tốt hơn để sử dụng swfObject trong JS, một cái gì đó như:

var flashvars = {}; 
var params = {}; 
params.wmode = "transparent"; 
var attributes = {}; 
swfobject.embedSWF("path/to/flash.swf", "id-of-the-div-the-flash-will-go", "800", "600", "9.0.0", false, flashvars, params, attributes);