PDA

View Full Version : Fade-In Application



hdave
23 Jul 2010, 4:45 PM
I would like to have my application fade in from a white page. I found an older thread here:

http://www.sencha.com/forum/showthread.php?67227-Start-my-application-quot-Faded-Out-quot&highlight=faded

At the end of it, sven suggested that rather than use the fade effect to fade-in the app, you could cover the app with "an absolute positioned div with white background color" and then, presumably fade out the white cover.

I'm such a newbie, I can't figure out how to create an absolute positioned div. Any help is appreciated!

I can make it work with a ContentPanel (!?), but how to get a big empty white square:


public void onModuleLoad() {
final Viewport v = new Viewport();
v.setLayout(new FitLayout());

MainForm mf = new MainForm();
v.add(mf);

final Viewport whiteViewportToFade = new Viewport();
whiteViewportToFade.setLayout(new FitLayout());

ContentPanel cp = new ContentPanel();
v2.add(cp);

RootLayoutPanel.get().add(v);
RootLayoutPanel.get().add(whiteViewportToFade);

FxConfig fxConfig = new FxConfig();
fxConfig.setDuration(2000);
whiteViewportToFade.el().fadeToggle(fxConfig);
}