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

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

问题描述

我在一个jQuery UI选项卡中有一个SWF电影,而我遇到的问题是,每当我从该选项卡点击另一个选项卡时,SWF都会重新加载,然后单击。我可以检查DOM,看到包含SWF的div仍然在DOM中,当我点击时,我不知道为什么它会重新加载它。



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

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





更新:事实证明这与下面的自2001年Firefox / Firefox 0.9以来一直存在的Firefox bug。然而,我仍然没有一个好的解决方法。

解决方案

(我很确定这是前段时间的工作)。我发现另一个解决方案:

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

  / **隐藏选项卡而不使用display:none; ** / 
.ui-tabs .ui-tabs-hide {
display:block!important;
身高:0!重要;
width:0!important;
border:none!important;
知名度:隐藏!重要;

}

  / **确保你的swf在隐藏时没有剩余高度** / 
.ui-tabs .ui-tabs-hide object,
.ui-tabs .ui-tabs-隐藏嵌入{
height:0;
width:0;
}

它适用于我。告诉我,如果你的作品!
杰罗姆·瓦格纳


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.

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;
}

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.

解决方案

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 :

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天全站免登陆