1.js方法

$('body').on('touchmove',function(event){
        event.preventDefault && event.preventDefault();
        event.returnValue=false;
        event.stopPropagation && event.stopPropagation();
        return false;
    })
//或者在对应的事件添加取消默认事件
$('.scrollDiv').on('touchmove',function(event){
   event.preventDefault(); 
})

问题:超出页面的部分不能滑动显示出来

2.css方法 (可以解决js方法产生的问题)

//body使用绝对定位
body {
    position: fixed;
}

 

posted on 2018-09-09 23:50  刘小北~!  阅读(1936)  评论(0编辑  收藏  举报