在jquery源碼中增加showMask()方法調用: if ( xhrSupported ) { jQuery.ajaxTransport(function( options ) { // Cross domain only allowed if supported through XMLHttp ...
在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", width: "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();
}
參考文件: