jquery blockUI 居中显示

var__widowWidth=$(window).width();

var__popWidth=$("#Loading").width();//Loading为要显示的div

var__left=(__widowWidth-__popWidth)/2+'px';

var__windowHeight=$(window).height();

var__popHeight=$("#Loading").height();

var__top=(__windowHeight-__popHeight)/2+'px';

$.blockUI({message:$('#Loading'),

css:{

cursor:'',

left:__left,width:__popWidth+'px',top:__top,position:'fixed',//居中

border:'none',//无边界

width:"100px"//中间框框的宽度

},

overlayCSS:{cursor:''}

});

相关推荐