Prevent iOS bounce without disabling scroll ability

前端 未结 7 1184
情歌与酒
情歌与酒 2020-11-28 06:14

I am trying to implement a solution to prevent the iOS bounce effect in Safari for iOS when a web page content is larger than the viewport.

The page I am working on

相关标签:
7条回答
  • 2020-11-28 07:02

    This code should stop the bounce as it's the HTML tag that bounces

    html {
        height  : 100%;
        overflow: hidden;
        position: relative;
    }
    body {
        height  : 100%;
        overflow: auto;
        position: relative;
    }
    
    0 讨论(0)
提交回复
热议问题