var mask = function(){
$('<div>').css({
  position: 'fixed',
  left: 0,
  top: 0,
  width: '100%',
  height: '100%',
  zIndex: '90',
  backgroundColor: 'rgb(0, 0, 0)',
  opacity: 0.5
}).appendTo('body').attr('id', '_jsPop');
$('#_jsPop').click(function(){
  $(this).remove();
});
};

在线DEMO: http://output.jsbin.com/biyibukuvo

相关文章: