简体   繁体   中英

ExtJs 4 - Fade In application viewport

I am trying to create a simple effect for my application which is to Fade it in from white over a period of 1-2 seconds so that the user doesn't have to see it being assembled.

I almost have it working, but there is some flickering that I can't seem to get rid of. Basically ExtJS is rendering my UI and then immediately hiding it so it can be faded in.

Here's my app:

Ext.application({
    name : 'MyApp', // Application level namespace
    appFolder : 'js/myapp', // Directory path to app
    autoCreateViewport : true,

    launch : function() {    
        // fade in the viewport
        var form = Ext.ComponentQuery.query("viewport")[0];
        form.getEl().fadeIn({
            from : {
                opacity : 0
            },
            duration : 1000 
        });

    }
});

What can I do to get rid of the initial draw before the FadeIn?

Took a wild guess that I could set the opacity of the viewport to 0 by default and it worked:

Ext.define('MyApp.view.Viewport', {
    extend : 'Ext.container.Viewport',
    style: 'opacity: 0;',
    items : [ {
        xtype : 'someview'
    } ]
});

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