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.
I'm using WKWebView on an iPhone, iOS 12. I got no help with
-webkit-overflow-scrolling:touch;
But, I was able to implement a smooth scroll using a WKUIDelegate method for intercepting alert() calls. Instead of performing the alert(), I set the scrollView's contentOffset to a position value that's sent via the alert().And the HTML file (Help.html):
What about applying the
-webkit-overflow-scrolling: touch;
to all elements of your site:And you should create an extra CSS file instead of using the css attribute.
overflow should be 'scroll'
ref: https://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements/