我想在加載AJAX內容時顯示ajax微調器。在IE7中不顯示jQuery Ajax微調器
下面的代碼似乎在Firefox中正常工作,但不在IE7中。顯示和隱藏微調器的函數被調用,但瀏覽器不顯示它。
這裏是jQuery的:
$.ajax({
url: filterorSearch,
data: {filterParams: JSON.stringify(filters), requestTime: new Date().getTime()},
beforeSend: function(){
showLoadingGraphic();
},
complete: function(){
hideLoadingGraphic();
},
success: function(data){
$("#BreakingNews").html(data);
GetRelatedarticles();
}
});
function showLoadingGraphic() {
alert("show");
var showSpinner = $('#page-placeholder-wrapper #main-left').prepend('<div id="ajaxLoader"></div>');
return showSpinner;
}
function hideLoadingGraphic() {
alert("hide");
var hideSpinner = $('#ajaxLoader').remove();
return hideSpinner;
}
而對於微調相關的CSS:
#page-placeholder-wrapper #main-left
{
position:relative;
}
#ajaxLoader
{
background:rgba(255,255,255,.7) url("../images/icon-ajax-loading.gif") no-repeat center center;
height:100%;
left:0;
position:absolute;
top:0;
width:100%;
z-index:9999;
}
那不是我害怕的。我正在爲客戶端工作localy,因此發佈該頁面不是一種選擇。這將是很好的,並欣賞輸入:) – RyanP13 2011-01-21 13:00:00
它看起來像你IE瀏覽器不執行前置時,我檢查它的顯示功能它的長度它回來0。 – RyanP13 2011-01-21 13:03:53
嗯,瘋狂的猜測 - 嘗試添加縮放:1的包裝元素觸發hasLayout - 可能是這樣 - 或丟失hasLayout在DOM樹的某處更高 – 2011-01-21 13:05:33