Вот большая подсказка:
Ext.define("App.view.Main", {
extend: 'Ext.tab.Panel',
config: {
fullscreen: true,
layout: {
animation: 'slide'
},
tabBarPosition: 'bottom',
items:[{
xtype:'panel',
iconCls: 'home',
title:'Tab 1',
html:'Tab1'
},{
xtype:'panel',
iconCls: 'user',
title:'Tab 2',
html:'Tab2'
},{
xtype:'panel',
iconCls: 'info',
title:'Tab 3',
html:'Tab3'
}],
listeners:{
activeitemchange:function(){
this.getLayout().setAnimation(['slide','fade','cover','reveal','pop', 'flip'][Math.floor(Math.random()*6)]);
}
}
}
});
По сути, когда пользователи меняют карты, устанавливается новая случайная анимация для макета панели вкладок среди тех, что в ['slide','fade','cover','reveal','pop', 'flip']
;
Не стесняйтесь вносить свой вклад, добавляя обработку параметра направления
[ОБНОВЛЕНИЕ] направление обработки
listeners:{
activeitemchange:function(){
var anim_with_direction = ['slide','cover','reveal'],
anim_without_direciton = ['fade','pop', 'flip'],
anims = anim_with_direction.concat(anim_without_direciton),
anim,
type = anims[0],
direction;
if(anim_with_direction.indexOf(type) != -1){
direction = ['left','right','up','down'][Math.floor(Math.random()*4)];
anim = {type:type,direction:direction};
}else{
anim = {type:type};
}
this.getLayout().setAnimation(anim);
}
}
person
Titouan de Bailleul
schedule
03.06.2012