Need to add in a splash screen before loading JS Application

2690
6
10-02-2015 01:16 PM
IanPeebles
Occasional Contributor III

Good afternoon.  Does anyone have any examples of any splash screen put together that loads first, then when you click OK the javascript application loads?  I have something put in place, but I have a flashing effect when the application loads that shows the text in the upper left corner before the entire application opens.  Here is an example:

0 Kudos
6 Replies
TimWitt2
MVP Alum

Did you try and build it programmatic, like in the first example here: dijit/Dialog — The Dojo Toolkit - Reference Guide

and then in your map.on("load"....  you use the myDialog.show() ?

SteveCole
Frequent Contributor

You could also make the CSS for the overall container of the map and associated divs default to "display:none" and then change the CSS display property via JS if they "accept" the splash screen notice.

IanPeebles
Occasional Contributor III

This seems like an interesting idea, but do you have an example?

0 Kudos
SteveCole
Frequent Contributor

I'd just use the example that Ken Buja​​ just posted. Just use his dojo/ready function code inside the click event of your "Yes- I agree" button on your splash screen.

0 Kudos
KenBuja
MVP Esteemed Contributor

Here's another method you can use: Re: Correct Loading procedures with a splash screen?

0 Kudos
KenBuja
MVP Esteemed Contributor

To get around the "resolving" issue, I have a div set up to cover everything in white

<div id="outerDIV"></div>

#outerDIV {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1000;
}

And using "dojo/ready", set the display on that div to none when everything is set up.

ready(function () {
    //this hides the div created to mask the site until it's ready
    domStyle.set(dom.byId("outerDIV"), "display", "none");

An example of that (and using a dialog) is here.