Does overflow:hidden applied to <body> work on iPhone Safari?
I had a similar issue and found that applying overflow: hidden;
to both html
and body
solved my problem.
html,
body {
overflow: hidden;
}
For iOS 9, you may need to use this instead: (Thanks chaenu!)
html,
body {
overflow: hidden;
position: relative;
height: 100%;
}
body {
position:relative; // that's it
overflow:hidden;
}
Some solutions listed here had some strange glitches when stretching the elastic scrolling. To fix that I used:
body.lock-position {
height: 100%;
overflow: hidden;
width: 100%;
position: fixed;
}
Source: http://www.teamtownend.com/2013/07/ios-prevent-scrolling-on-body/