页面添加 mask 遮罩层

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

posted @ 2016-04-13 17:10  roseforyou  阅读(1115)  评论(0)    收藏  举报