flash在firfox下,如果使用display属性,会导致flash重新加载,这时候只能用visibility属性。并设置容器的width和height为0,自己的程序这样实现没有问题。
如果是在Ext的tab控件中,通过控件切换隐藏和显示flash。则需要做如下操作:
- 设置tab控件的hideMode属性为visibility,可能会带来性能的损耗,见红字部分
Ext.create('Ext.tab.Panel', {
deferredRender: false,
region: 'center',
activeTab: 0,
defaults: {
hideMode: 'visibility'
},
listeners: {
beforetabchange: function(tabPanel, newCard, oldCard, options) {
oldCard.setWidth(0);
oldCard.setHeight(0);
}
},
items: [{
layout: 'fit',
contentEl: 'othertackel_panel',
title: '其他应用1',
id: 'item_othertackel_panel',
closable: false
},{
layout: 'fit',
contentEl: 'othertackel_panel',
title: '其他应用',
id: 'item_othertackel_panel',
closable: false
}]
}); - 添加listeners 监控beforetabchange控件,修改原来容易的width和height,如下红字部分
Ext.create('Ext.tab.Panel', {
deferredRender: false,
region: 'center',
activeTab: 0,
defaults: {
hideMode: 'visibility'
},
listeners: {
beforetabchange: function(tabPanel, newCard, oldCard, options) {
oldCard.setWidth(0);
oldCard.setHeight(0);
}
},
items: [
{
layout: 'fit',
contentEl: 'othertackel_panel',
title: '其他应用1',
id: 'item_othertackel_panel',
closable: false
},{
layout: 'fit',
contentEl: 'othertackel_panel',
title: '其他应用',
id: 'item_othertackel_panel',
closable: false
}]
});