简体   繁体   中英

How to set ExtJS window show/hide with animation?

Here is My sourcecode:

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

When i call show(...),the window will show without any animation. I want to add some animation,such as fadein/fadeout/slidein/slideout. Can somebody help me? Thank you!

You can use Anim object http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.fx.Anim to use in your Window Component like this:

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

And then, that animation is added when your call to

window.show();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM