首页 > 代码库 > easyui dialog 扩展load
easyui dialog 扩展load
$.extend($.fn.panel.methods, {
showMask: function(jq, msg){
return jq.each(function(){
var pal = $(this).panel(‘panel‘);
if (pal.css(‘position‘).toLowerCase() != ‘absolute‘){
pal.css(‘position‘,‘relative‘);
}
var borderSize = parseInt(pal.css(‘padding‘))+1;
var m = pal.children(‘div.panel-mask‘);
if (!m.length){
m = $(‘<div class="panel-mask"></div>‘).appendTo(pal);
}
m.css({
background:‘#fff‘,
left:borderSize,
top:(borderSize+pal.children(‘.panel-header‘)._outerHeight()),
right:borderSize,
bottom:borderSize
});
m.children(‘div.panel-mask-msg‘).remove();
var mm = $(‘<div class="panel-mask-msg"></div>‘).appendTo(m);
mm.html(msg).css({position:‘absolute‘}).css({
position:‘absolute‘,
top: ‘50%‘,
left: ‘50%‘,
marginTop: -mm._outerHeight()/2,
marginLeft: -mm._outerWidth()/2
})
});
},
hideMask: function(jq){
return jq.each(function(){
$(this).panel(‘panel‘).children(‘div.panel-mask‘).remove();
})
}
});
调用方法:
$(‘#dlg‘).dialog(‘showMask‘, ‘Loading...‘); // display the loading message
$(‘#dlg‘).dialog(‘hideMask‘); // hide the loading message
easyui dialog 扩展load