亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

微信小程序彈窗禁止頁面滾動的實現(xiàn)代碼

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

下面給大家介紹下小程序彈窗禁止頁面滾動的效果:

在這里插入圖片描述

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

<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
 }
})

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

相關文章

最新評論