2012-05-07 35 views

回答

2

你給的例子只使用ajaxStart和ajaxReady,沒有任何進展。 據我所知,沒有辦法通過jQuery來阻止調用的進度。

+0

是的,我知道有沒有進步,這就是爲什麼我問,如果它是可能的。好於圖片必須足夠。 –

-1

你好DEMO http://jsfiddle.net/5ZRfY/ ==>http://jsfiddle.net/je5qchss/

這樣的事情也許。 請看這裏:http://api.jquery.com/ajaxComplete/http://api.jquery.com/ajaxSuccess/http://api.jquery.com/jQuery.ajax/(有一些很好的讀取)

你總是可以把呼叫啓動和停止時,阿賈克斯成功完成!

jQuery代碼

$(document).ready(function() { 

    $('#progressBar').append('<div id="bar"></div>'); 

    // percentage of completion 
    var progress = '100%'; 

    // Animate the #bar div 
    $('#bar').animate({ 
     width: progress 
    }, 400); 

});​ 

HTML

<div id='progressBar'></div>​ 

CSS

body{ 
    background:#f6f6f6;  
} 

/*Styling of progress bar container*/ 
#progressBar{ 
    width:300px;/*It is important to define the width of the progress bar*/ 
    height:40px; 
    padding:0px; 
    background:#ccc; 
    border:1px solid #aaa; 
    -moz-box-shadow: inset 0 0 3px #888; 
    -webkit-box-shadow: inset 0 0 3px #888; 
    box-shadow: inset 0 0 3px #888; 
} 
/*styling the progress bar*/ 

#bar{ 
    background:#499aed; 
    height:100%; 
    width:0; /*sets the bar to 0*/ 
}​ 
+4

此進度條始終移動0.4秒並且沒有顯示實際負載 – vladkras