[英]Show Spinning Animation while Page Loads ASP.NET
我想知道在我的 web 应用程序中,用户单击菜单,有时会缓冲加载页面。
因此,我用来创建系统的主题为此内置了 animation。 我如何在加载时触发它,直到页面完全加载以查看。
这是animation
<div id="loading" class="overlay"><i class="fas fa-2x fa-sync-alt fa-spin"></i></div>
这就是我目前将其放置在页面上的方式。
<div class="card">
<div class="card-header">
<h3 class="card-title">
<b>Company List</b>
</h3>
</div>
<div id="loading" class="overlay">
<i class="fas fa-2x fa-sync-alt fa-spin"></i>
</div>
<!-- /.card-header -->
<div class="card-body p-0">
<table class="table table-striped">
<tr>
<th> Company Name </th>
<th> @Html.DisplayNameFor(model => model.Status) </th>
<th></th>
</tr>
<tbody> @foreach (var item in Model) { <tr>
<td> @Html.DisplayFor(modelItem => item.CompanyName) </td>
<td> @Html.DisplayFor(modelItem => item.Status) </td>
<td> @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-warning pull-right" }) @Html.ActionLink("View", "Details", new { id = item.Id }, new { @class = "btn btn-success pull-right" }) @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { @class = "btn btn-danger pull-right" }) </td>
</tr> } </tbody>
</table>
</div>
<!-- /.card-body -->
</div>
我用过这个 JQuery
<script>
$(window).load(function () {
$('#loading').hide();
});
</script>
$(window).load()
已在 jQuery 3.0 中删除。 尝试使用:
$(window).on('load', function () {
$('#loading').hide();
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.