Click here to Skip to main content
15,902,032 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have just implemented a loading gif on all my ASP pages that shows a loading Progress until page has loaded.
However, often the load is so fast that the spinner i barely shown.
How do i extend the time the loading gif is shown - to eg. 2 seconds

My code is html with JavaScript:

HTML
<body onload="init()">
     <div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;"><img src="Images/loading.gif" border=0></div> 
     <script>
 var ld=(document.all);
 var ns4=document.layers;
 var ns6=document.getElementById&&!document.all;
 var ie4=document.all;
 if (ns4)
 ld=document.loading;
 else if (ns6)
 ld=document.getElementById("loading").style;
 else if (ie4)
 ld=document.all.loading.style;
 function init()
 {
 if(ns4){ld.visibility="hidden";}
 else if (ns6||ie4) ld.display="none";
 }
 </script>
Posted
Updated 7-Jun-16 4:41am
v4

1 solution

All Internet users want faster Internet. When someone really needs some GIF or any other resource, this person wants to see it immediately, and only the result of the loading, such as fully shown animated image, and never the process of loading, no matter how graphical and sophisticated your show is. If Internet throughput for every user was much faster, no one would need your "loading progress" show. Believe me, every time the user sees your "spinner", this person hates it.

And now, you want to slow down the loading process, with the sole purpose: to show the user how good your "spinner" is or your programming skills are. Two seconds of the user's torture, no less! Do you really hate your users so much?

Conclusion: simply stop being an enemy for your users.

—SA
 
Share this answer
 
v5
Comments
Kristian_dk 7-Jun-16 10:58am    
I see your point. You are absolutely right. I was simply aiming for consistency in my entire web application. But you are right!
Sergey Alexandrovich Kryukov 7-Jun-16 11:36am    
Thank you for your understanding.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900