xinheng

弹出 fixed 弹窗后,在弹窗上滑动会导致下层的页面一起跟着滚动。

解决方法:

在弹出层加上 catchtouchmove 事件

两种方法:(在电脑上测试是没有用的,这是触摸事件。因此,需要在手机端测试,预览生成一个开发版,用手机微信扫描即可看到效果)

1.

wxml:

<!-- 首页弹窗 -->
<view class=\'Popup\' hidden=\'{{bool}}\' catchtouchmove="test">
js:
  test:function(){
},
2.catchtouchmove="true"就行了,(个人感觉第二种方法比较简单,好用)
<!-- 首页弹窗 -->
<view class=\'Popup\' hidden=\'{{bool}}\' catchtouchmove="true">

 

分类:

技术点:

相关文章: