黑色蒙版提示

/* 黑色蒙版修饰 */
.wrapper{
width: 100%;
height: 100%;
background-color: rgba(0,0,0,.5);
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: none;
}
.show-message{
width: 200px;
height: 200px;
background: white;
margin: 0 auto;
}

<div class="wrapper">
<div class="show-message">
提交失败请请重试!!
</div>
</div>

//提交失败出现提示弹窗
var bodyheight = $('.wrapper').height();
var height = $('.show-message').height();
$('.show-message').css('margin-top',(bodyheight-height)/2 + 'px')
$('.wrapper').show();
return false;

posted @ 2020-07-16 17:00  搲社会主义墙角  阅读(102)  评论(0编辑  收藏  举报