EasyUI Forum

General Category => General Discussion => Topic started by: argumentum on March 04, 2018, 06:15:50 PM



Title: [Solved] heavy page, 4000 lines, ..how to load it ? with a spinner ?
Post by: argumentum on March 04, 2018, 06:15:50 PM
So my page is 4000+ lines and while loading, it shows all the controls in an unformatted, HTML looking, ugly thing.
To hide the ugliness, I hide the <body>, like so:
Code:
<script>
document.write('<style>body{visibility:hidden;}</style>');
jQuery(document).ready(function(){
delay();
});
function delay() {
var secs = 1;
setTimeout('initFadeIn()', secs);
}
function initFadeIn() {
jQuery("body").css("visibility","visible");
jQuery("body").css("display","none");
jQuery("body").fadeIn(200);
}
</script>
It does the job of showing the page when its ready but it can take 10+ sec. in a slow connection and the page looks blank, lifeless, dead, as if nothing is going on or something is wrong.

My question is: is there a way to show a spinner of sorts while the <body> is ready to be shown ?
If you can provide an example page in  http://code.reloado.com (http://code.reloado.com) ( or similar ) better.

Thanks


Title: Re: heavy page, 4000 lines, ..how to load it ? with a spinner ?
Post by: argumentum on March 04, 2018, 08:18:23 PM
...I really looked around before posting ..., found a way in
Code:
https://www.isostech.com/blogs/software-development/quick-easy-page-loading-overlay-spinner-part-2/


So I'm happy with the result  :)