[英]loading bar is not displaying in chrome
當我點擊我的分頁器鏈接時,我想顯示一個加載欄。 分頁器通過 ajax 函數。 當我使用 mozila 時,它會顯示加載欄。 但是當我使用 chrome, safari 時,它沒有顯示加載欄
我的加載欄是一個 div,它存在於我的 index.php 文件中。
<div class="loading_wrapper" id="loading_wrapper" style="display:none;">
<div class="load_animation"><img src="/magsonwink/images/loadinfo.gif" width="24" height="24" /></div>
<div class="load_texts"><h4>Loading...</h4></div>
<div class="clear"></div>
分頁器鏈接也存在於 index.php 文件中。 當我單擊分頁器鏈接時,這將轉到該功能
var resp_msg =
$.ajax({
url: path + set_page,
async: false,
beforeSend: function() {
$('#loading_wrapper').show();
},
success: function(data, result) {
if (!result)
alert('Failure to set the value.');
}
}).responseText;
if (resp_msg) {
$('#loading_wrapper').hide();
$(objReplace).html(resp_msg);
}
這在 mozila 中工作正常,但在 chrome 中不行。 當我查看錯誤控制台時沒有顯示錯誤。請幫助我。 提前致謝
試試這個
var resp_msg =
$.ajax({
url: path + set_page,
async: false,
beforeSend: showloader() ,
success: function(data, result) {
if (!result)
alert('Failure to set the value.');
}
}).responseText;
if (resp_msg) {
$('#loading_wrapper').hide();
$(objReplace).html(resp_msg);}
function showloader(){ $('#loading_wrapper').show(); }
為什么“異步”設置為“假”。 將屬性設置為“true”應該可以解決問題!
你測量過響應時間嗎? 是不是來得太快了? 與 Firefox 相比,Chrome 和 IE 需要更多時間來渲染圖像。 您的圖像隱藏/顯示可能沒有足夠的時間進行渲染。 通過應用一些延遲來檢查這一點,您也可以在 Chrome 和 IE 中看到該圖像
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.