遮罩层出来后页面滚动问题

一、自定义遮罩层javascript

.customMask{
    position: fixed;
    width: 100%;
    height: 100%;
    /* top: 0; */
    /* left: 0; */
    background: rgba(0, 0, 0, 0.6);
    z-index: 11;
    right: 0;
    display: flex;
    justify-content: flex-end;
    padding-bottom: 2.25rem;
}

二、遮罩层出来后页面滚动问题处理css

2.1:csshtml

/*遮罩层显示时body的样式*/
.notScroll {
    overflow: hidden;
}

2.2:jsjava

/**
 * 打开弹框
 * @author 2019-05-06
 */
function openQRcodePop(good) {
    // 遮罩出来后让body不可滚动
    $('body,html').addClass('notScroll');
}
/**
 * 关闭弹框
 * @author 2019-05-06
 */
function closeQRcodePop() {
    // 遮罩去掉以后body 可滚动
    $('body,html').removeClass('notScroll');
}
相关文章
相关标签/搜索