0
以下代碼是在.NET應用程序的異步回發期間顯示帶灰色背景的div彈出式加載器。如何從HideProgress()中的「body」中刪除CSS類模式?從創建的div中刪除cs
function ShowProgress() {
setTimeout(function() {
modal = $('<div />');
modal.addClass("modal");
$('body').append(modal);
var loading = $(".loading");
loading.show();
var top = Math.max($(window).height()/2 - loading[0].offsetHeight/2, 0);
var left = Math.max($(window).width()/2 - loading[0].offsetWidth/2, 0);
loading.css({ top: top, left: left });
}, 200);
}
function HideProgress() {
//alert('hideloading');
document.getElementById("loading").onsubmit = null;
document.getElementById('loading').style.display = 'none';
document.getElementById("body").onsubmit = null;
document.getElementById('body').style.display = 'none';
//alert('done');
}
謝謝 - 我認爲保羅打了你幾秒鐘的答案。我會upvote,但我還不能! – Biggs