html - 如何让flash悬浮在网站上方?

标签 html css flash layout

我有一个 Flash 媒体播放器,我希望它漂浮在我们论坛的顶部,这样当用户向下滚动时,媒体播放器就会跟随。

我还没有找到一种方法让它位于 html 之上。它总是把它压低。

你可以在http://www.gcehosting.com/stackoverflow看到我说的媒体播放器

这是代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>Music Player Widget - Preview 2</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css" media="screen">
        html, body { height:100%; background-color: #000000;}
        body { margin:0; padding:0; overflow:hidden; }
        #flashContent { width:100%; height:100%; }
        </style>
    </head>
    <body>

        <div id="flashContent">

            <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="main" align="middle">
                <param name="movie" value="main.swf" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#ffffff" />
                <param name="play" value="true" />
                <param name="loop" value="true" />
                <param name="wmode" value="transparent" />
                <param name="scale" value="showall" />
                <param name="menu" value="true" />
                <param name="devicefont" value="false" />
                <param name="salign" value="" />
                <param name="allowScriptAccess" value="sameDomain" />

                <!--[if !IE]>-->
                <object type="application/x-shockwave-flash" data="main.swf" width="100%" height="100%">
                    <param name="movie" value="main.swf" />
                    <param name="quality" value="high" />
                    <param name="bgcolor" value="#ffffff" />
                    <param name="play" value="true" />
                    <param name="loop" value="true" />
                    <param name="wmode" value="transparent" />
                    <param name="scale" value="showall" />
                    <param name="menu" value="true" />
                    <param name="devicefont" value="false" />
                    <param name="salign" value="" />
                    <param name="allowScriptAccess" value="sameDomain" />
                <!--<![endif]-->
                    <a href="http://www.adobe.com/go/getflash">
                        <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>

        </div>

    </body>
</html>

我希望有人能够提供解决方案

最佳答案

您可以将wmode 参数设置为transparent,这会使您的SWF 的所有非对象区域都透明。然后使用绝对 CSS 定位将其置于网页中任何位置的顶部。

来自this tutorial的相关代码片段:

#wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 900;
  height: 900;
  z-index: 1;
}
<div id="wrapper">
  <object>
    <param name="movie" value="dummy.swf">
    <param name="wmode" value="transparent">
    <embed src="dummy.swf" wmode="transparent">
  </object>
</div>

关于html - 如何让flash悬浮在网站上方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9524010/

相关文章:

javascript - 重新加载 ng-repeat 数据失败,我做错了什么?

html - 我的 html 表单和纯 css 有问题吗?

flash - JW Player 需要流媒体服务器?

flash - 比较 HTML5 和 Flash 应用程序的性能

.net - 嵌入式 Flash 视频 : works locally, 但不在登台服务器上

javascript - 更改 JSON 时无法读取未定义的属性 'appendChild'

html - 请推荐: static site generator without ruby

javascript - 在 "Select"上更新在新选项卡中打开网址...仅一次

html - 使用 ng-repeat 更改可见元素不透明度的图像列表

html - 使用复选框在调整后的大小和带有滚动条的原始大小之间切换图像大小