如何阻止 jQuery UI 选项卡内的 SWF 重新加载 [英] How to stop SWF inside of a jQuery UI tab from reloading

查看:20
本文介绍了如何阻止 jQuery UI 选项卡内的 SWF 重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 jQuery UI 选项卡中有一个 SWF 电影,我遇到的问题是每次我从选项卡单击到另一个选项卡,然后单击返回时,SWF 都会重新加载.我可以检查 DOM 并看到当我单击离开时包含 SWF 的 div 仍在 DOM 中,所以我不知道为什么当我单击返回选项卡时它似乎重新加载它.

I have a SWF movie inside of a jQuery UI tab, and the problem I'm having is that the SWF gets reloaded everytime I click away from the tab onto another tab, and then click back. I can inspect the DOM and see that the div containing the SWF is still in the DOM when I click away, so I don't know why this it seems to reload it when I click back to the tab.

我添加了以下 CSS 规则以防止将显示设置为:none,但 Flash 电影仍在重新加载:

I added the following CSS rules to try to prevent the display being set to: none, but the Flash movie is still reloading:

.ui-tabs .ui-tabs-hide {
    display: block !important;
    position: absolute;
    left: -10000px;
}

更新:事实证明这与以下 Firefox 错误有关自 2001 年/Firefox 0.9 以来一直存在.但是,我仍然没有好的解决方法.

Update: It turns out this is related to the following Firefox bug which has been around since 2001 / Firefox 0.9. I still don't have a good workaround however.

推荐答案

前面提到的解决方案在 Chrome 中有效,但由于某种原因在 Firefox 中无效(我很确定它在一段时间前有效).我找到了另一个解决方案:

The solution mentioned earlier works in Chrome but not in Firefox for whatever reason (I am quite sure it was working some time ago). I found yet another solution :

首先你需要一个通用规则来隐藏"内容而不使用 display:none;

first you need a generic rule to "hide" the content without using display:none;

/** hide the tab without using display:none; **/
.ui-tabs .ui-tabs-hide {    
display: block !important;
height: 0!important;
width: 0!important;
border:none!important;
visibility:hidden!important;

}

/** make sure your swf does not have leftover height when hidden **/
.ui-tabs .ui-tabs-hide object,
.ui-tabs .ui-tabs-hide embed {
    height: 0;
    width: 0;
}

它对我有用.告诉我是否适合你!杰罗姆·瓦格纳

It works for me. Tell me if if works for you ! Jerome WAGNER

这篇关于如何阻止 jQuery UI 选项卡内的 SWF 重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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