显示延长时间加载gif [英] Extend time loading gif is shown

查看:258
本文介绍了显示延长时间加载gif的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的所有ASP页面上实现了一个加载gif,显示加载进度直到页面已加载。

然而,通常负载是如此之快以至于我几乎没有显示的微调器。 />
如何延长加载gif的显示时间 - 例如。 2秒



我的代码是带JavaScript的HTML:



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:

<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>

推荐答案

所有互联网用户都希望更快互联网。当某人真的需要一些GIF或任何其他资源时,这个人想要立即看到它,只有加载的结果,例如完全显示的动画图像,而不是加载的过程,无论你的节目如何图形化和复杂化。如果每个用户的Internet吞吐量要快得多,那么没有人需要您的加载进度节目。相信我,每当用户看到你的旋转器时,这个人就讨厌它。



现在,你想减慢加载过程,只有一个目的:向用户显示您的微调器有多好或您的编程技巧。两秒钟用户的折磨,不下!你真的很讨厌你的用户吗?



结论:简单地停止成为你的用户的敌人。



-SA
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


这篇关于显示延长时间加载gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆