How to prevent pull-down-to-refresh of mobile chrome

后端 未结 4 1059
我在风中等你
我在风中等你 2020-12-09 15:15

I want to prevent pull-down-to-refresh of mobile chrome(especially iOS chrome). My web application has vertical panning event with device-width and device-height viewport, b

4条回答
  •  鱼传尺愫
    2020-12-09 15:29

    Try this.

    body {
      /* Disables pull-to-refresh but allows overscroll glow effects. */
      overscroll-behavior-y: contain;
    }
    

    It worked well for me. I had weird scrolling issues due to other javascript hacks. Read this article for more details.

    https://developers.google.com/web/updates/2017/11/overscroll-behavior

提交回复
热议问题