将iframe与Flash内容分开 [英] Div above iframe with flash content

查看:154
本文介绍了将iframe与Flash内容分开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Flash内容的iframe上方放置div(例如YouTube视频)。
我无法访问iframe中的内容,因此我无法修改其中的内容。



我尝试了很多东西( z-index ...一切)。
但没有任何效果。我只是问,因为我真的找不到解决方案:($ / b>

问题是,iframe包含Flash内容。


<解决方案我不能真正帮助测试解决方案,因为我没有任何Flash文件来测试创建答案,但我可以告诉你为什么会发生这种情况。

Flash是一个浏览器插件,这意味着Flash电影从来不是HTML文档的一部分,而是页面区域被保留用于插件运行,然后被调用并在页面顶部运行,因此在其他元素上设置z-index永远不会真正解决问题,无论你尝试什么样的组合。 b
$ b

但是,您可以在插件识别的元素上设置一个'魔术'参数/属性,称为wmode。如果将此参数/属性设置为'transparent', Flash插件允许一些HTML元素显示如果你能够联系iframe的所有者来设置wmode参数为透明的,我会建议这样做。如果这是一个youtube或vimeo嵌入,看看是否有任何文档或选项自己添加参数。



如果没有很多你可以做的,甚至JavaScript在这里你不会成为你的朋友(出于安全原因,你不能修改JS的内容)



编辑:



请记住,如果您有一种使用HTML5视频而不是Flash的方式,那会有所帮助。 HTML5视频是作为文档对象模型的一部分呈现的,因此可以通过z-index属性进行控制。



Neal


I want to place a div above an iframe with flash content (for example like a youtube video). I do not have access to the content in the iframe, so I can't modify something in there.

I've tried a lot of things (z-index... everything). But nothing works. I am only asking because I really can't find a solution :(

The problem is that the iframe contains the flash content.

解决方案

I can't really help with a tested solution I'm afraid, as I don't have any flash files to test creating an answer with, but I can tell you why this is happening.

Flash is a browser plugin, which means flash movies are never really part of the HTML document. Instead what happens is the area of the page is reserved for the plugin to run in, which is then invoked and runs 'on top' of the page. Therefore setting z-index on other elements will never actually solve the problem, no matter what combination you try.

However, there is a 'magic' parameter / attribute you can set on the elements themselves that the plugin recognises, called "wmode". If you set this parameter / attribute to 'transparent', the Flash plugin allows some HTML elements to show through, giving the illusion that they are on top of the Flash movie.

If you're able to contact the owner of the iframe to set the wmode parameter to transparent, I'd suggest doing that. If this is a youtube or vimeo embed, see if there's any documentation or options on adding the parameter yourself.

Failing that there's not a lot you can do, as even JavaScript won't be your friend here (you can't modify the contents of a frame with JS for security reasons)

EDIT:

Just remembered, if there's a way of you using HTML5 video instead of Flash, that would help. HTML5 videos are rendered as part of the Document Object Model, and therefore are controllable through the z-index property.

Neal

这篇关于将iframe与Flash内容分开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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