页面加载动画 [英] Page loading animation
问题描述
我想在页面加载时显示一个加载动画,当加载完成时,显然要隐藏它.
I want to display a loading animation while my page is loading, and when loading is complete then obviously hide it.
我正在使用Masterpages在ASP.NET中工作,只是想知道有没有一种简单的方法可以使用JQuery做到这一点?
I am working in ASP.NET using Masterpages, just wondering there is a a simple way of doing this using JQuery?
任何指针将不胜感激.
谢谢
推荐答案
只需在页面上放置带有动画gif的图像.为其指定一个loadingImage的ID,并添加以下脚本:
Just place an image with the animated gif on the page. Give it an id of loadingImage and add the following script:
$(document).ready(function(){
$('#loadingImage').hide();
});
顺便说一句,您的页面加载需要多长时间?是否使用AJAX调用来加载数据?也许您应该对此进行研究,然后在回调处理程序中,在图像上调用hide()函数.
Incidentally, how long is your page taking to load? Is it using AJAX calls to load data? Maybe you should look into this and in the callback handler, call the hide() function on your image.
这篇关于页面加载动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!