首页 > 代码库 > easyui dialog 扩展load
easyui dialog 扩展load
1 $.extend($.fn.panel.methods, {
2 showMask: function(jq, msg){
3 return jq.each(function(){
4 var pal = $(this).panel(‘panel‘);
5 if (pal.css(‘position‘).toLowerCase() != ‘absolute‘){
6 pal.css(‘position‘,‘relative‘);
7 }
8 var borderSize = parseInt(pal.css(‘padding‘))+1;
9 var m = pal.children(‘div.panel-mask‘);
10 if (!m.length){
11 m = $(‘<div class="panel-mask"></div>‘).appendTo(pal);
12 }
13 m.css({
14 background:‘#fff‘,
15 left:borderSize,
16 top:(borderSize+pal.children(‘.panel-header‘)._outerHeight()),
17 right:borderSize,
18 bottom:borderSize
19 });
20 m.children(‘div.panel-mask-msg‘).remove();
21 var mm = $(‘<div class="panel-mask-msg"></div>‘).appendTo(m);
22 mm.html(msg).css({position:‘absolute‘}).css({
23 position:‘absolute‘,
24 top: ‘50%‘,
25 left: ‘50%‘,
26 marginTop: -mm._outerHeight()/2,
27 marginLeft: -mm._outerWidth()/2
28 })
29 });
30 },
31 hideMask: function(jq){
32 return jq.each(function(){
33 $(this).panel(‘panel‘).children(‘div.panel-mask‘).remove();
34 })
35 }
36 });
2 showMask: function(jq, msg){
3 return jq.each(function(){
4 var pal = $(this).panel(‘panel‘);
5 if (pal.css(‘position‘).toLowerCase() != ‘absolute‘){
6 pal.css(‘position‘,‘relative‘);
7 }
8 var borderSize = parseInt(pal.css(‘padding‘))+1;
9 var m = pal.children(‘div.panel-mask‘);
10 if (!m.length){
11 m = $(‘<div class="panel-mask"></div>‘).appendTo(pal);
12 }
13 m.css({
14 background:‘#fff‘,
15 left:borderSize,
16 top:(borderSize+pal.children(‘.panel-header‘)._outerHeight()),
17 right:borderSize,
18 bottom:borderSize
19 });
20 m.children(‘div.panel-mask-msg‘).remove();
21 var mm = $(‘<div class="panel-mask-msg"></div>‘).appendTo(m);
22 mm.html(msg).css({position:‘absolute‘}).css({
23 position:‘absolute‘,
24 top: ‘50%‘,
25 left: ‘50%‘,
26 marginTop: -mm._outerHeight()/2,
27 marginLeft: -mm._outerWidth()/2
28 })
29 });
30 },
31 hideMask: function(jq){
32 return jq.each(function(){
33 $(this).panel(‘panel‘).children(‘div.panel-mask‘).remove();
34 })
35 }
36 });
1 $(‘#dlg‘).dialog(‘showMask‘, ‘Loading...‘); // display the loading message
2 $(‘#dlg‘).dialog(‘hideMask‘); // hide the loading message
2 $(‘#dlg‘).dialog(‘hideMask‘); // hide the loading message
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。