美文网首页
小程序 弹出层有滚动事件 处理方法

小程序 弹出层有滚动事件 处理方法

作者: Gollum128 | 来源:发表于2019-02-18 10:19 被阅读0次

转至:https://blog.csdn.net/mcyang0929/article/details/79162090

1.如果弹出层没有滚动事件,就直接在蒙板上加catchtouchmove=”move” move:function(){};

wxml

<view class='mask' catchtouchmove="move"></view>

js

//在page中添加一个函数,这个函数内容为空

move:function(){}

2.如果弹出层有滚动事件,那么在弹出层出现的时候给底部的content加上一个class,消失的时候移除。

wxml

<view class="bodyLock">

wxss

.bodyLock{
    top:0px;
    left: 0px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    z-index: 0;
}

相关文章

网友评论

      本文标题:小程序 弹出层有滚动事件 处理方法

      本文链接:https://www.haomeiwen.com/subject/txnoeqtx.html