移动端页面中,有时需要禁止用户滑动屏幕

document.body.addEventListener('touchmove', function(e) {

  e.stopPropagation();//阻止默认事件
  e.preventDefault();//阻止冒泡
});

posted @ 2018-08-31 10:03  美滋滋的胖虎  阅读(327)  评论(0编辑  收藏  举报