欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序彈窗禁止頁(yè)面滾動(dòng)的實(shí)現(xiàn)代碼

 更新時(shí)間:2020年12月30日 16:01:00   作者:任我行RQ  
這篇文章主要介紹了微信小程序彈窗禁止頁(yè)面滾動(dòng)的實(shí)現(xiàn)代碼,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

下面給大家介紹下小程序彈窗禁止頁(yè)面滾動(dòng)的效果:

在這里插入圖片描述

在小程序彈窗時(shí),外部頁(yè)面禁止?jié)L動(dòng), 可以在最外部容器設(shè)置catchtouchmove
但是如果彈窗內(nèi)部也需要滾動(dòng),需要用scroll-view包裹,并設(shè)置scroll-y
catchtouchmove需要接收個(gè)方法,不然會(huì)一直警告

<view class="box">占位</view>
<view class="pop" catchtouchmove="touchMove">
 <view class="popbg"></view>
 <view class="popup">
  <scroll-view scroll-y>
   <view class="row" wx:for="{{10}}" wx:key="index">{{index}}</view>
  </scroll-view>
 </view>
</view>
.box {
 height: 120vh;
}

.popbg {
 position: fixed;
 top: 0;
 left: 0;
 width: 100%;
 height: 100%;
 background: rgba(0, 0, 0, 0.7);
}

.popup {
 position: fixed;
 top: 20%;
 left: 50%;
 transform: translate(-50%, 0);
 width: 70%;
 background: #fff;
 z-index: 1;
}

scroll-view {
 height: 500rpx;
}

.row {
 width: 100%;
 height: 200rpx;
}
Page({
 touchMove() {
  return
 }
})

到此這篇關(guān)于微信小程序彈窗禁止頁(yè)面滾動(dòng)的文章就介紹到這了,更多相關(guān)小程序彈窗禁止頁(yè)面滾動(dòng)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論