在jquery源码中增加showMask()方法调用:
if ( xhrSupported ) {
jQuery.ajaxTransport(function( options ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !options.crossDomain || support.cors ) {
var callback;
return {
send: function( headers, complete ) {
showMask();
......
在jquery源码中增加hideMask()方法调用:
// Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) {
//alert(1);
hideMask();
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
if ( state === 2 ) {
return;
}
......
//调用的是easyui的效果
// Load
function showMask() {
$("<div class="datagrid-mask"></div>").css({ display: "block", "100%", height: $(window).height() }).appendTo("body");
$("<div class="datagrid-mask-msg"></div>").html("正在运行,请稍候。。。").appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(window).height() - 45) / 2 });
}
// hidden Load
function hideMask() {
$(".datagrid-mask").remove();
$(".datagrid-mask-msg").remove();
}
参考文件: