轉自:https://www.jianshu.com/p/6fb10c78bbd7
實現遮罩效果
- Html
<view class='mask-view'> ... </view>
- CSS
.mask-view { width: 100%; height: 100%; position: fixed; overflow: hidden; background-color: #ffffff; z-index: 999; top: 0; left: 0; }
阻止遮罩層下的頁面滾動
只需要在遮罩層上加上catchtouchmove='ture'
需要注意的是:因模擬器無touch事件,需在真機上測試
<view class='mask-view' catchtouchmove='ture'> ... </view>