微信小程序中遮罩層的滾動穿透問題


 

如果彈出層沒有滾動事件:

<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