简体   繁体   English

Div加载前的进度条

[英]Progress Bar Before Div Loading

  1. I need to show a progress bar or loading gif for 5 seconds before class .tiles is shown each time page loads 我需要在每次加载页面时显示进度条或加载gif 5秒钟,然后显示类.tiles。

Need to show a simple "reload game" or "try again" button after function success inside class .tiles area instead of BootstrapDialog.show on whole page modal like in code below 函数成功在类.tiles区域内后需要显示一个简单的“重新加载游戏”或“重试”按钮,而不是在整个页面模式下显示BootstrapDialog.show,如下面的代码

Not have much knowledge of ajax 不太了解Ajax

first create a div with laoding gif, where you want to display it 首先使用劳德gif创建一个div,您要在其中显示它

<div id="loadingmessage" style="display:none;"><img src="URL"></div>

then use this before your ajax call 然后在ajax调用之前使用它

$('#loadingmessage').show();

then after success or failure function 然后成功或失败后的功能

$('#loadingmessage').hide();

same is the case with button, create a button and sets it to display:none; 按钮的情况相同,创建一个按钮并将其设置为display:none; then after success function calls it to show. 然后在成功函数调用后显示。 I hope it helps. 希望对您有所帮助。

You can use pace which requires minimal setup and will run automatically for every ajax request. 您可以使用需要最少设置的速度 ,并将针对每个ajax请求自动运行。

Pace is a light weighted library and you have the freedom to customize your loader. Pace是一个轻量级的库,您可以自由定制装载程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM