加载样式js

 

var MaskUtil = (function(){  
      
    var $mask,$maskMsg;  
      
    var defMsg = '数据导出中,请稍待。。。';  
      
    function init(){  
        if(!$mask){  
            $mask = $("
").appendTo("body"); } if(!$maskMsg){ $maskMsg = $("
"+defMsg+"
") .appendTo("body").css({'font-size':'12px'}); } $mask.css({width:"100%",height:$(document).height()}); var scrollTop = $(document.body).scrollTop(); $maskMsg.css({ left:( $(document.body).outerWidth(true) - 190 ) / 2 ,top:( ($(window).height() - 45) / 2 ) + scrollTop }); } return { mask:function(msg){ init(); $mask.show(); $maskMsg.html(msg||defMsg).show(); } ,unmask:function(){ $mask.hide(); $maskMsg.hide(); } } }());

用法

MaskUtil.mask(); 

MaskUtil.unmask(); 

 

点赞

Leave a Reply

Your email address will not be published. Required fields are marked *