如何防止使用 iframe 重新加载 Flash 播放器?

发布于 2024-08-03 02:18:27 字数 225 浏览 1 评论 0原文

我有一个网站,有一个巨大的背景图片。我需要在网站顶部放置一个Flash播放器,我刚刚意识到他们点击的每个页面都是一个新页面,因此重新启动了Flash播放器。所以我想将该 Flash 播放器放在 iframe 中,以便它在用户冲浪期间继续播放。

但我的问题是 iframe 会覆盖背景图像而不是在下面吗?或者页面的背景图像(不是 iframe)会很好地位于 iframe 下方,而没有人会了解我的方法?任何帮助将不胜感激。

I have a website that has a huge background image. I need to put a flash player at the top of the website, and I just realized that each page they click on is a new page, and thus restarts the Flash player. So I would like to put that flash player in an iframe so it will continue to play throughout the user surfing.

But my issue is will the iframe cover the background image and not be underneath? Or will the background image of the page (not iframe) go nicely underneath the iframe and no one will be the wiser of my methods? Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

¢好甜 2024-08-10 02:18:27

首先,您想要做的是将各个页面内容放入 iframe(而不是 Flash 视频)中,因为这是您想要更新的内容。您希望 Flash 位于实际的父页面上,以便它始终保持不变。 (或者将两者放在单独的 iframe 中并且仅更新内容 iframe)。

关于您关于 iframe 背景的问题,您可以将其设置为透明,以便通过它仍然可以看到背景。

为此,请在 iframe 上将 ALLOWTRANSPARENCY 属性设置为 true,例如

<iframe width="100%" height="500px" name="content" src="home.html" frameborder=0 allowtransparency="true"></iframe>

,然后在 iframe 中将包含的页面中将正文的背景设置为透明:

<body style="background-color:transparent">

Firstly what you want to do is put your individual pages contents into an iframe (not the flash video) as this is what you want to update. You want the flash to be on the actual parent page so it always remains the same. (or put both in seperate iframes and only update the content iframe).

In regards to your question about the iframes background you can make it transparent so that the background is still visible through it.

To do this set the ALLOWTRANSPARENCY property to true on your iframe e.g.

<iframe width="100%" height="500px" name="content" src="home.html" frameborder=0 allowtransparency="true"></iframe>

And then in the pages which are going to be contained in the iframe set the body's background to be transparent:

<body style="background-color:transparent">
冬天旳寂寞 2024-08-10 02:18:27

iframe 很糟糕,并且带走了所有关于框架的垃圾内容(如果你想阅读的话,谷歌“为什么框架很糟糕”)。

您应该关注的是一些 AJAX 技术。 JavaScript 框架,例如 DojojQuery 有很多功能您可以查看。这将使用户能够在电影播放时进行投票、添加收藏夹或评论等操作 - 与 YouTube 非常相似。

不过,这在一定程度上取决于您在 HTML 页面下运行的内容。您能否提供更多相关信息?

Iframes are bad, and take with them all the shitty stuff about frames (google "why frames are bad" if you want some reading).

What you should be looking at is some AJAX-techniques. JavaScript frameworks like Dojo and jQuery have lots of functionality you could check out. This will enable users to do things like vote, add to favourites or comment while the movie is playing - pretty much like Youtube.

It all depends a little on what you've got running underneath your HTML-pages though. Could you provide some more information about that?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文