如何在 Windows 上的 Firefox 中阻止 Flash 内容闪耀 jQuery UI 对话框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/602678/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:05:27  来源:igfitidea点击:

How to stop Flash content shine-through jQuery UI Dialog in Firefox on Windows

jquerywindowsflashinternet-explorerfirefox

提问by DEfusion

I'm using the jQuery UI dialog box, in IE & FF on Windows I'm getting underlying Flash content shining through the dialog box.

我正在使用 jQuery UI 对话框,在 Windows 上的 IE 和 FF 中,我正在通过对话框获取底层 Flash 内容。

I resolved this on IE by enabling the bgiframeoption on the jQuery dialog window and changing the bgiframescript to apply to any windows browsers, however I'm still getting the shine-through on FF.

我在 IE 上通过启用bgiframejQuery 对话框窗口上的选项并更改bgiframe脚本以应用于任何 Windows 浏览器解决了这个问题,但是我仍然在 FF 上大放异彩。

Note that I can't know exactly where the Flash content will be showing as it is usually Flash widgets that users have added to pages, although I have thought about hiding the Flash content temporarily while displaying the dialog box - is this the only option left to me?

请注意,我无法确切知道 Flash 内容将显示在哪里,因为它通常是用户添加到页面的 Flash 小部件,尽管我曾考虑在显示对话框时暂时隐藏 Flash 内容 - 这是唯一剩下的选项吗对我来说?

回答by David Hanak

Try the wmode=transparentor wmode=opaqueparameter.

试试wmode=transparentorwmode=opaque参数。

回答by quark

<object ...>
  ...
  <param name="wmode" value="opaque" />
  ...
  <embed ... wmode="opaque" ...></embed>
</object>

回答by TheVillageIdiot

I'd faced similar problem once. I simply hide the flash and show it again when dialog is dismissed:

我曾经遇到过类似的问题。我只是隐藏闪光灯并在对话框关闭时再次显示它:

<script type="text/javascript">
    /*notification dialog setup*/
        function SetupDialog()
        {
            $("div#divNotice").dialog(
                {  autoOpen: false,
                   modal: true,
                   overlay: { opacity: 0.5, background: '#050505' },
                   buttons: {
                              "I Agree": function(){
                                            $("#Movie").css("display","inline")//Show movie when dialog is closed
                                            .......
                                        },
                              "Close" : function(){
                                            $("#Movie").css("display","inline") //Show Movie if dialog is closed
                                            $(this).dialog("close");
                                        }
                            },
                   title: "",
                   height: 500,
                   width: 600,
                   dialogClass: 'myDialog',
                   position: 'center'
                 }
            );
        }
    </script>
    <script type="text/javascript">
    function ShowDialog()
    {
        /*for Notice dialog */
        $("#divDialog").css("display","block");
        $("#Movie").css("display","none");
        $("div#divDialog").dialog("open");
    }

回答by Fanooos

the jquery ui dialog uses a css file called jquery-ui-x.x.css where x.x indicated the version

jquery ui 对话框使用名为 jquery-ui-xxcss 的 css 文件,其中 xx 表示版本

in this file you can give the .ui-dialog class overflow:auto; this will solve the problem

在这个文件中你可以给 .ui-dialog 类 overflow:auto; 这将解决问题

回答by Jpsy

Please be warned that changing the wmode of your Flash animation will seriously increase the CPU load of you machine and slow down your animations. The Flash player uses its own window on top of the browser window for good reason. With wmode set to opaque Flash is forced to render into the browser window. With wmode=transparent it even must merge its renderings with existing browser stage content.

请注意,更改 Flash 动画的 wmode 会严重增加机器的 CPU 负载并减慢动画速度。Flash 播放器在浏览器窗口顶部使用自己的窗口是有充分理由的。wmode 设置为不透明 Flash 被迫呈现到浏览器窗口中。使用 wmode=transparent 它甚至必须将其渲染与现有的浏览器舞台内容合并。

I usually use the same technique that is also used by many lightbox scripts: switch all Flash movies invisible as long as the dialog is visible. This should NOT be done by setting display:none. The result could be shifted content in the rest of the page if the Flash rectangle is not on stage any more. For the same reason you should NOT use jQueries hide() method. Instead, use visibility:hidden which still occupies the space of the hidden element.

我通常使用许多灯箱脚本也使用的相同技术:只要对话框可见,就将所有 Flash 电影切换为不可见。这不应该通过设置 display:none 来完成。如果 Flash 矩形不再出现在舞台上,结果可能会移动页面其余部分的内容。出于同样的原因,您不应该使用 jQueries hide() 方法。相反,使用仍然占据隐藏元素空间的可见性:隐藏。

Here is my way of doing it:

这是我的做法:

$('#myDialogId').dialog({
    open: function(){
        // hide any flash objects
        $('object').css('visibility', 'hidden');
        // hide any flash embeds
        $('embed').css('visibility', 'hidden');
    },
    close: function(){
        // show any flash objects
        $('object').css('visibility', 'visible');
        // show any flash embeds
        $('embed').css('visibility', 'visible');
        //
    }
});

回答by Stiropor

Either use iFrame in dialog box or hide flash contents on page when dialog box is fired.

在对话框中使用 iFrame 或在触发对话框时隐藏页面上的 Flash 内容。