overlay html over flash? [duplicate]

烂漫一生 提交于 2019-12-04 13:08:56

问题


Possible Duplicate:
Div Z-Index issue with Flash movie

Is it possible to overlay a piece of html over a flash animation given this context: -flash contents underneath is NOT clickable -html will contain js link clicking which will open an iframe popup similar to: http://www.dynamic-tools.net/toolbox/popUp/

thanks!


回答1:


It is not standards-compliant, but try adding wmode="transparent" to the embed tag as follows:

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

With these parameters set, the flash movie should obey CSS z-index settings.




回答2:


Basically Mike Koval's answer will do the job, that is setting wmode="transparent". All other HTML/CSS/JS things will remain the same from your own link.

Full embedding code HTML version (by swfObject's generator) will be:

<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>

It will be always better to use swfObject in JS, something like:

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);


来源:https://stackoverflow.com/questions/1567420/overlay-html-over-flash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!