<style>
#BgDiv{
100%;
height:100%;
background-color: rgba(0,0,0,0.05);
opacity: 0.3;
}
</style>
<div id="BgDiv" style="display: none;"></div>
关闭按钮加class .click-close-hide
点击显示按钮 #newQuestionBtn 和#addTable
<script>
// 遮罩层显示隐藏
//点击增加让出现遮罩层
$('body').on('click','#addTable',function(){
$('#BgDiv').show();
$('#BgDiv').css("z-index","1000");
})
//点击新增问题让出现遮罩层,同时让增加的弹框隐藏
$('body').on('click','#newQuestionBtn',function(){
$('#BgDiv').show();
$('#BgDiv').css("z-index","1000");
$('.modal-dialog.modal-lg .modal-content ').hide();
})
$('body').on('click','.click-close-hide',function(){
$('#BgDiv').hide();
$('.modal-dialog.modal-lg .modal-content ').show();
$('#BgDiv').css("z-index","-1");
})
</script>