0

I have encountered this problem before and so far I have applied ajax beforeSend:function() parameter to display a loading image, though for normal form requests and page reload is there any alternative way to display a loader instead of just a plain white background as to prevent clients from thinking the pages has crashed.

4

1 回答 1

1

我更喜欢在 body 标签的中心有一个“正在加载”的图像作为背景。应用程序/站点的主包装器将针对 ajax 调用进行切换,您只需在主包装器上切换一个类。当包装器被隐藏时,您可以在正文上看到加载图像,直到新内容到达。相当便宜的方式,在移动设备上看起来不错。

演示

于 2013-10-10T20:17:23.513 回答