![](/img/trans.png)
[英]ExtJS: Destroy window with config 'closeAction' set to 'hide'
[英]How to set ExtJS window show/hide with animation?
這是我的源代碼:
Ext.create('Ext.window.Window', { id:'edit_segtype_win', title:'msg', layout: 'fit', html:data, modal:true, resizable:false, constrain:true }).show(undefined,bind_ajax_success);
當我調用show(...)時,窗口將顯示沒有任何動畫。 我想添加一些動畫,例如fadein / fadeout / slidein / slideout。 有人能幫助我嗎? 謝謝!
您可以使用Anim對象http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.fx.Anim在您的Window組件中使用,如下所示:
var myWindow = Ext.create('Ext.window.Window', {
html:"hello world",
});
Ext.create('Ext.fx.Anim', {
target: myWindow,
duration: 1000,
from: {
width: 400, //starting width 400
opacity: 0, // Transparent
color: '#ffffff', // White
left: 0
},
to: {
width: 300, //end width 300
height: 300 // end height 300
}
});
然后,當您致電時添加該動畫
window.show();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.