13上禁用滚动弹跳效果

13上禁用滚动弹跳效果

本文介绍了CSS:在iOS 13上禁用滚动弹跳效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在中,该声明不再需要将以下内容应用于元素以启用弹跳滚动效果:

In Safari 13 release notes it is stated that there is no longer the need to apply the following to an element to enable the bounce scroll effect:

div {
  overflow-x: scroll;
  -webkit-overflow-scrolling: touch; /* No longer needed */
}

但是,我现在不再禁用使用以下代码实现此效果:

However, I can now no longer disable this effect with the following code:

div {
  overflow-x: scroll;
  -webkit-overflow-scrolling: auto;
}

我需要这个作为我正在处理的传送带。关于如何解决它的任何想法?

I need this for a carousel I am working on. Any idea on how to fix it?

推荐答案

我认为您应该尝试使用Safari中阻止了弹跳滚动行为。为此,必须在滚动div的父容器中进行设置:

I think you should try to change that using the overflow property that in Safari blocks the bouncing scroll behaviour. To do that in the parent container of your scrolling div you have to set:

overflow: hidden;

然后在您的div中设置以下内容:

and then in your div set something like this:

div {
  overflow: auto;
}

这篇关于CSS:在iOS 13上禁用滚动弹跳效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 04:25