微信小程序中遮罩层的滚动穿透问题


 

如果弹出层没有滚动事件:

<view wx:if="{{alert}}" catchtouchmove="myCatchTouch">
     <template is="alert" data="{{alertData}}" />
</view>
myCatchTouch: function () {
    console.log('stop user scroll it!');
    return;
},

 

如果弹出层有滚动事件,那么在弹出层出现的时候给底部的containerView加上一个class 消失的时候移除。

<view class="{{showModalView?'tripList_root':''}}">
.tripList_root{
    top:0px;
    left: 0px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    z-index: 0;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM