0
我想阻止用戶界面和解除阻止ajax調用的UI開始和停止。有人可以指導我如何實現這一點。屏蔽與jquery和css的屏幕
jQuery代碼
var $loading = $('#Processing').hide();
$(document)
.ajaxStart(function() {
var $body = $('body');
this.$mask = $('<div class="DialogMask"></div>');
$body.append(this.$mask);
$loading.show();
})
.ajaxStop(function() {
var $body = $('body');
this.$mask = $('<div class="DialogMask"></div>');
$body.remove(this.$mask);
$loading.hide();
});
CSS代碼
div.DialogMask
{
padding: 10px;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 50;
background-color: #606060;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
-moz-opacity: .5;
opacity: .5;
}