易学问答
  • 首页
  • 话题
  • 动态
  • 专家
  • 文章
  • 作者
  • 公告
  • 更多
    • 积分规则
登录 或 注册
  • 首页
  • 话题
  • 动态
  • 专家
  • 文章
  • 作者
  • 公告
  • 积分规则
 发表新帖
发表新帖

Div scrolling freezes sometimes if I use -webkit-overflow-scrolling

后端 未结
关注
 4  1808
不要未来只要你来
不要未来只要你来 2020-12-13 01:41

if I use -webkit-overflow-scrolling for a scrolling div, it scrolls perfectly with native momentum. But, div itself sometimes freezes and does not respond my fi

4条回答
  •  半阙折子戏
    半阙折子戏 (楼主)
    2020-12-13 02:19

    Try using overflow: hidden on body. This should resolve the issue: https://codepen.io/cppleon/pen/vYOgKzX

    HTML

    
    
      
        
        
        
      
      
        

    CSS

    body {
      /* magic is here */
      overflow: hidden;
    }
    
    #scrollable-content {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 50%;
      background-color: gray;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    
    .site-header {
      width: 100%;
      height: 120px;
      background-color: orange;
    }
    
    .main-content {
      height: 200%;
    }
    

    0 讨论(0)
    查看其它4个回答
    提交评论

    •  加载中...
 看不清?
提交回复
热议问题