EasyUI Forum
March 28, 2024, 03:54:38 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Solved] heavy page, 4000 lines, ..how to load it ? with a spinner ?  (Read 4478 times)
argumentum
Newbie
*
Posts: 22



View Profile
« 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 ( or similar ) better.

Thanks
« Last Edit: March 04, 2018, 08:18:41 PM by argumentum » Logged
argumentum
Newbie
*
Posts: 22



View Profile
« Reply #1 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  Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!