I need to disable inertial scrolling on the body element for the iPad, but keep the ability to scroll the page without inertia.
I searched for a while, but I did not find any good solutions. Maybe I just wasn’t looking for the right one? Is there any hack or workaround that could make this possible?
You can use div with overflow property, it kills iOS smooth scroll
<body> <div class="scroll"> long long text... <div> </body>
Css
html, body { height: 100%; margin: 0; overflow: hidden; } .scroll { overflow: auto; height: 100%; }
http://jsbin.com/palixi/edit
Add this to the body CSS element:
body
-webkit-overflow-scrolling: auto;
The default value for -webkit-overflow-scrolling is touch . This tells iOS devices to use inertial scrolling. Docs: https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-overflow-scrolling
-webkit-overflow-scrolling
touch
@Meuwka's answer reaches your goal, but in a circular way - it works because div elements have -webkit-overflow-scrolling: auto; as their default value.
div
I used inobounce , which can be found here
inobounce
You will notice that you need to specify the height and overflow: auto property for the element you want to scroll, including -webkit-overflow-scrolling: touch; . The documents explain well.
height
overflow: auto
-webkit-overflow-scrolling: touch;
Source: https://habr.com/ru/post/976358/More articles:Domain error = com.alamofire.error.serialization.response Code = -1011 "Request error: invalid request (400) - jsonHK2 annotations are not processed - java"a ++ + i" equals "(a ++) + i" - cFixed columns and heading using CSS / Angular JS - htmlFast array behavior - arraysHow to use IResourceChangeListener to detect file rename and dynamically change EditorPart name? - eclipseError: request failed: request with bad request (400) via afnetworking in swift - apiHow to add a horizontal scrollbar to specific columns of an HTML table without using a table in a table in the following scenario? - htmlFacebook Custom Audience Pixel at SinglePageApplication SPA - angularjsRenaming a resource file does not change the name of the editor part - eclipseAll Articles