如图 用户滚动的时候,出现这些空白,会影响我页面本身的自带的滚动效果,体验很差,有什么方法给固定住吗
目前在网上找到的方法
这个ios13以上没有效果,已测
document.body.addEventListener('touchmove', function(evt) {
if(!evt._isScroller) {
evt.preventDefault();
}
});
这个会完全禁止touchmove 导致内部无法滚动。
document.body.addEventListener('touchmove', function (e) {
if(e._isScroller) return;
e.preventDefault();
}, {passive: false}); //passive 参数不能省略
Iscroll 试试 或者试试div绝对定位 通过div内滚动试试
example : vt.ooteco.com