Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical scrolling in iOS not smooth

Tags:

css

I've been searching far and wide through documentation regarding -webkit-overflow-scrolling: touch;, but I can only get it to work partially for my <body> element this way...

<body style="-webkit-overflow-scrolling: touch;"> 

or like this...

<body style="overflow-y: auto; -webkit-overflow-scrolling: touch;"> 

In iOS, my page will scroll with momentum about a fourth of the way down in the page, but then stop. So -webkit-overflow-scrolling: touch does work for a "part" of the body

Without this code, it will scroll all of the way through the page, but with no momentum and with a lot of jerky motion.

like image 414
Matt Avatar asked May 19 '16 04:05

Matt


People also ask

How do I make my scroll smoother?

In the Chrome browser, do the following. Type chrome://flags and hit Enter. Search for 'smooth'. Select Enabled against Smooth scrolling and restart the browser.

Is there a safari equivalent for scroll behavior Smooth?

Safari 15.4 adds support for CSS scroll-behavior as detailed in the 15.4 release notes. Added support for the CSS scroll-behavior property and ScrollOptions, allowing smooth scrolling to anchors or via JavaScript. I've tested and it works on 15.4 (Safari Technology Preview).

Is smooth scrolling good?

With smooth scrolling, it slides down smoothly, so you can see how much it scrolls. This might not be a huge deal for you but it is a big deal for users who read a lot of long pages. The choppy scroll might be annoying for a lot of users and that's why people are moving towards the smooth scroll option.


2 Answers

What about applying the -webkit-overflow-scrolling: touch; to all elements of your site:

* {     -webkit-overflow-scrolling: touch; } 

And you should create an extra CSS file instead of using the css attribute.

like image 80
moritzm3 Avatar answered Sep 20 '22 16:09

moritzm3


overflow should be 'scroll'

ref: https://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements/

like image 27
Pandiarajan Avatar answered Sep 21 '22 16:09

Pandiarajan