CSS: Disable bounce effect for scroll on iOS 13

2020-06-16 04:17发布

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? Thanks!

2条回答
The star\"
2楼-- · 2020-06-16 04:49

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;

and then in your div set something like this:

div {
  overflow: auto;
}
查看更多
疯言疯语
3楼-- · 2020-06-16 05:11

I don't know if i really understand this correct, but here it goes! :)

Can't you just remove that line of code from your file?

You could also try to write -webkit-overflow-scrolling: auto; !important

Hope this helped :

查看更多
登录 后发表回答