Disable scrolling in an iPhone web application?

后端 未结 9 1778
遇见更好的自我
遇见更好的自我 2020-11-27 10:36

Is there any way to completely disable web page scrolling in an iPhone web app? I\'ve tried numerous things posted on google, but none seem to work.

Here\'s my curre

9条回答
  •  温柔的废话
    2020-11-27 11:09

    I tried above answers and particularly Gajus's but none works. Finally I found the answer below to solve the problem such that only the main body doesn't scroll but other scrolling sections inside my web app all work fine. Simply set position fixed for your body:

    body {
    
    height: 100%;
    overflow: hidden;
    width: 100%;
    position: fixed;
    }
    

提交回复
热议问题