要添加AJAX页面加载动画效果: 第1步:添加jQuery库
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
第2步:添加一些CSS给炫酷的外观(可选) 3步:添加下面的jQuery
<script>
(function($){
$("html").removeClass("v2");
$("#header").ready(function(){ $("#progress-bar").stop().animate({ width: "25%" },1500) });
$("#footer").ready(function(){ $("#progress-bar").stop().animate({ width: "75%" },1500) });
$(window).load(function(){
$("#progress-bar").stop().animate({ width: "100%" },600,function(){
$("#loading").fadeOut("fast",function(){ $(this).remove(); });
});
});
})(jQuery);
</script>
第4步:最后,添加html代码,无论你想要的。
+1 - 用于指向进度条的链接。您也可以在设置页面时开始下载,然后在页面完成时显示数据。在页面完成之前,Javascript可以进行ajax调用。 – 2009-09-30 17:31:33
谢谢,我没有想到用ajax加载实际报告。我认为这将解决它。 – nolanpro 2009-09-30 21:28:31
Jquery UI是一个可怕的臃肿解决方案。 – 2011-05-06 15:10:51