使用"-webkit-overflow-scrolling:触摸"时,是否停止过度滚动? [英] Stop overscroll when using "-webkit-overflow-scrolling: touch"?

查看:93
本文介绍了使用"-webkit-overflow-scrolling:触摸"时,是否停止过度滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了:

-webkit-overflow-scrolling: touch;

css元素可让我们在ios上进行本地滚动.这对我来说似乎正常.

css element to give us native scrolling on ios. This seems to work ok for me.

但是有办法关闭过度滚动"效果吗?

But is there a way to turn off the "overscroll" effect?

例如,当滚动位置= 0,并且您一直向下拖动时,内容的顶部将向下移动,从而在其上方显示一些空白.松开手指时,内容将向上弹回.有没有办法只禁用其中的一部分?

For example, when scroll position = zero, and you keep dragging downwards, the top of my content will move downwards revealing a little bit of white space above it. When you release your finger, the content snaps back upwards. Is there a way to disable just that portion of it?

我也从这里读到

http://cantina.co /2012/03/06/ios-5-native-scrolling-grins-and-gothcas/

该苹果为此引入了一个与渲染相关的错误,并修复了以下问题:

that apple had introduced this with a bug related to rendering, and a hack fix of:

-webkit-transform: translate3d(0,0,0);

应该修复它. ios6修复了这个问题吗?

is supposed to fix it. Was that fixed with ios6?

推荐答案

您是否尝试过这篇有关关闭弹性滚动的博文?具体来说,对于iOS,它建议使用以下JavaScript:

Have you tried the techniques in this blog post about turning off elastic scrolling? Specifically, for iOS it suggests the following JavaScript:

document.addEventListener(
  'touchmove',
  function(e) {
    e.preventDefault();
  },
  false
);

这篇关于使用"-webkit-overflow-scrolling:触摸"时,是否停止过度滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆