Hi, is there a way to make a page to wait for a javascript to finish first before displaying page contents? Or to disable mouse clicks until javacripts finishes loading?
Isn't this the same idea as the 'loading page' topic earlier this month? Like some sort of HTML/CSS-absolute positioned overlay to be displayed first, and eventually removing it with javascript (which will be the very last action javascript performs, hence: js is finished).
Unless you have some 5000+ line script or a buttload of intervals or timeouts your script already does run before the page content is loaded. provided the script is in the head at least.
just put a absolutely positioned div at the top of the page (below head but above all content) and give it a width and height of the full page so it covers everything then give it a high z-index. then at the very end of your script select that div and give it a display: none property
I would say, people don't like being "Unable to do anything" ever, so it'll be pretty tough to accomplish.
#loadingscreen {position:absolute;
top:0;
bottom:0;
left:0;
right:0;
z-index:30;
background: #fff url('loadingimg.gif') center center;
}
Make sure to have a loading image so people don't get totally pissed about the white screen.