首页 > 技术文章 > 阻止小程序遮罩层下方图层滚动

wang-xx 2019-08-24 18:09 原文

原因是因为:

  touchmove事件冒泡;
解决方案:

  阻止遮罩层冒泡,在小程序里面 利用catch+事件名就可以阻止冒泡,

  所以 在遮罩层填上事件 

    catchtouchmove="preventdefault"
  小程序1.5.0后可以写上
    capture-catch:touchmove="preventdefault"
完美 哈哈;

推荐阅读