jQuery对话框顶部的Flash [英] Flash on top of jQuery dialog

查看:127
本文介绍了jQuery对话框顶部的Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道很多人问这个问题,但我认为我的情况有所不同。



我有一个网站,我有一些广告是Flash隐藏的因为xhtml / html兼容性问题。但是Flash元素在我的jQuery对话框之上,这是不太理想的。



有些解决方案建议将wmode设置为不透明,但不能因为我的广告是脚本输出Flash元素。



另一个解决方案建议在显示对话框时隐藏广告。所以我的问题是:有没有办法把闪存内容放在我的jQuery对话框后面,而它们是可见的,而不改变闪存代码?



最好的问候,
Lasse Espeholt



更新:
我现在已经用一个赏金重新获得了这个问题。至于现在,我把每个Flash广告都隐藏在显示对话框上。但这还不是一个最佳的解决方案。所以,我正在寻找一个脚本,可以使每个Flash动画变得不透明(一个jQuery解决方案将是最好的,但一个纯粹的JavaScript解决方案将做)。或者如果这个问题中还没有讨论另外一个解决方案,我会很高兴地听到:)



更新2:
到目前为止,我已经做了这个脚本:

  function opaqueAllFlashMovies(){
// Embed Flash movies
$('embed [wmode!=opaque]')。attr('wmode','opaque')。wrap('< div>');

//具有wmode参数的对象flash电影
$('object [classid $ = - 444553540000] parem [wmode]')attr('value','opaque' );
//没有wmode参数的对象flash电影
$('object [classid $ = - 444553540000]')。not('param [wmode]')。append('¶m name = \'wmode\''value = \'opaque\''/>')。wrap('< div>');
}

哪些适用于FF和Chrome,但不在IE中。显然, .append 失败。任何想法?

解决方案

除非将wmode设置为不透明(或透明),否则无法将HTML放在Flash前面。 / p>

使用默认的wmode(window),Flash Player接管其所在的所有呈现和用户交互。因此浏览器无法在该区域显示任何HTML。 wmode =opaque(或wmode =transparent)是否禁用此默认行为,并将Flash Player区域整合到浏览器中,通常呈现和分层等。



但是,您不需要更改任何Flash内容来设置wmode,因为它是在HTML(或通过SWFObject或插入Flash对象元素的其他脚本)完成的,所以如果您可以控制脚本它会输出您提到的Flash元素,您可以在那里处理wmode设置。


I know many have asked this question, but I think my situation is a little bit different.

I have a site where I have some ads which is Flash hidden in a because of xhtml/html compatibility issues. But the flash elements is on top of my jQuery dialogs which is not ideal.

Some solutions have suggested setting wmode to opaque but I can't because my ads are scripts which outputs flash elements.

Another solution suggested hiding ads when a dialog is shown. So my question is: Is there a way to put flash content behind my jQuery dialogs while they are visible and without altering the flash code?

Best regards, Lasse Espeholt

Update: I have now reopned the question with a bounty. As for now, I hide every Flash ad on "show dialog". But this is still not an optimal solution. So, I'm looking for a script which can make every Flash animation to opaque (a jQuery solution would be nicest, but a plain JavaScript solution will do). Or if there should be another solution not discussed in this question, I'll be happy to hear about it :)

Update 2: So far, I have made this script:

function opaqueAllFlashMovies() {
    // Embed Flash movies
    $('embed[wmode!="opaque"]').attr('wmode', 'opaque').wrap('<div>');

    // Object flash movies with a wmode param
    $('object[classid$="-444553540000"] parem[wmode]').attr('value', 'opaque');
    // Object flash movies without a wmode param
    $('object[classid$="-444553540000"]').not('param[wmode]').append('<param name=\'wmode\' value=\'opaque\'/>').wrap('<div>');
}

which works in FF and Chrome but not in IE. Apparently, .append fails. Any ideas?

解决方案

You can't put HTML in front of Flash unless you set wmode to opaque (or transparent).

With the default wmode ("window") the Flash Player takes over all rendering and user interaction in its area. So the browser can't display any HTML in that area. What wmode=" opaque" (or wmode="transparent") does is that it disables this default behavior and kind of integrates the Flash Player area in the browsers usual rendering and layering and such.

But you don't need to alter any Flash content to set wmode, since it is done in the HTML (or via SWFObject or other script that inserts the Flash object element) so if you have control over the "scripts which outputs flash elements" that you mention, you can take care of the wmode setting there.

这篇关于jQuery对话框顶部的Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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