var MAX_Z_INDEX=100; //记录页面中的最大zindex值
$("#xx").show().css({position:'absolute',top:0,left:0,zIndex:++MAX_Z_INDEX});
#mask{ position:absolute; top:0; left:0; 800px; height:600px; background:#000; filter:alpha(opacity=75); -ms-filter:"alpha(opacity=75)"; opacity:.75; z-index:99; }
<div id="mask" style="display:none;"></div>
$("#mask").show();