新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
怎么在微信小程序中實(shí)現(xiàn)彈窗禁止頁面滾動功能-創(chuàng)新互聯(lián)
本篇文章為大家展示了怎么在微信小程序中實(shí)現(xiàn)彈窗禁止頁面滾動功能,內(nèi)容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細(xì)介紹希望你能有所收獲。
在小程序彈窗時,外部頁面禁止?jié)L動
, 可以在最外部容器設(shè)置catchtouchmove
但是如果彈窗內(nèi)部也需要滾動,需要用scroll-view
包裹,并設(shè)置scroll-y
catchtouchmove
需要接收個方法,不然會一直警告
占位 {{index}}
.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)容就是怎么在微信小程序中實(shí)現(xiàn)彈窗禁止頁面滾動功能,你們學(xué)到知識或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識儲備,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
網(wǎng)頁名稱:怎么在微信小程序中實(shí)現(xiàn)彈窗禁止頁面滾動功能-創(chuàng)新互聯(lián)
標(biāo)題網(wǎng)址:http://www.dlmjj.cn/article/eeess.html