如何在HTML页面顶部嵌入瑞士法郎? [英] How to embed a swf on top of a html page?

查看:82
本文介绍了如何在HTML页面顶部嵌入瑞士法郎?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将swf嵌入到html页面上,就像浮动视频观看面板一样。我已经有一个swf文件,它将根据浏览器的大小自动调整其大小,并且swf文件是部分透明的。我以为我可以添加div标签,将位置设为绝对位置并更改z-index较大,但这是行不通的,因为swf只是替换了页面上的所有内容。

I want to embed a swf over a html page, like a floating video watching panel. I already have a swf file which will automatically adjust its size according to the browser size, and the swf file is partially transparent. I thought I can just add a div tag, make the position absolute and change z-index bigger, but that doesn't work because the swf just replaced everything that's on the page.

这就是我所做的

<script>
      swfobject.embedSWF("swf/float.swf", "header", "100%", "100%", "9.0.0");
</script>

<body bgcolor="#000000">
      <div id="header"></div>
      <div id="shell">
          things in my html
      </div>
</body>

#header {
    position:absolute;
    z-index:100;

}

有什么想法吗?谢谢。

推荐答案

一旦调整大小即可正常工作,则需要将 wmode 设置为透明以便能够看到闪光灯后面的内容,否则,背景将变得不透明。

Once you get your sizing to work properly you will need to set the wmode to transparent to be able to see what's behind the flash, if you don't it's background will be opaque.

这是从 swfobject文档,但应该可以理解:

This is a quick copypaste from the swfobject docs, but it should get the point across:

<script type="text/javascript">

var flashvars = {};
var params = {wmode : "transparent"};
var attributes = {};

swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);

</script>

这篇关于如何在HTML页面顶部嵌入瑞士法郎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆