简体   繁体   English

禁用水平滚动Android

[英]Disable Horizontal Scrolling Android

I have a weird issue with horizontal scrolling to the right 我在向右水平滚动时遇到了一个奇怪的问题

  • I already made html/body width max at 100% and overflow-x hidden 我已经将html / body的最大宽度设为100%,并且将x隐藏起来
  • no elements outside viewport or negative margins to the right 视口外没有任何元素或右边距为负边距
  • this issue isn't present on desktop 桌面上不存在此问题
  • meta user-scalable=no 元用户可缩放=否
  • horizontal scrolling is set to false for stellar.js Disable horizontal scroll on parallax stellar.js的水平滚动设置为false 禁用视差水平滚动

I honestly can't think of any reason why and this issue is only on android. 老实说,我想不出任何原因,这个问题只在android上。 http://bit.ly/1v0jVlh http://bit.ly/1v0jVlh

将iScroll与Stellar.js结合使用时,它具有css .mobile #wrapper,如果您希望使其在android上正常工作,则必须删除绝对位置。

Use this css in your sheet (for mobile), it will disable the horizontal scrolling but would allow vertical scrolling. 在工作表中使用此CSS(用于移动设备),它将禁用水平滚动,但将允许垂直滚动。

body{
    postion: relative;
    width: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    }
html{
       overflow-x: hidden;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM