简体   繁体   English

溢出-x:iPhone 上的自动不滚动

[英]overflow-x: auto on iPhone is not scrolling

I have an iframe inside a div, which looks like:我在 div 中有一个 iframe,它看起来像:

<div align="center" style="z-index:0; -webkit-transform: translate3d(0,0,0); overflow-x:auto; -webkit-overflow-scrolling-x: touch"> 
    <a href="c1" data="c1"></a>
    <script type="text/javascript" src="iframe-loader"></script>
</div> 

I want the entry form to be scrollable on the x-axis, so that it can be used in mobile phones.我希望输入表单可以在x轴上滚动,以便可以在手机中使用。 This is working correctly on desktop and other phones, such as Android, but when using Safari in iOS the scroll is not present or works randomly.这在桌面和其他手机(如 Android)上正常工作,但在 iOS 中使用 Safari 时,滚动不存在或随机工作。

Any possible fixes for this?任何可能的修复方法? Is this an iOS bug?这是iOS错误吗?

I saw in your sources that you use bootstrap so why you don't just adapt the with to be all inside the screen without any scrolling (horizontal scrolling on cellphone is not really user-friendly for me). 我在你的消息来源中看到你使用bootstrap,所以为什么你不只是调整使用屏幕而不进行任何滚动(手机上的水平滚动对我来说不是真的用户友好)。

If you really want to use scrolling, I recommend you to use: 如果你真的想使用滚动,我建议你使用:

-webkit-overflow-scrolling: touch;

instead of 代替

-webkit-overflow-scrolling-x: touch;

Have you tried to use !important ? 你尝试过使用过!important吗?

I just went to this website on my iPhone, and the form scrolled easily on the X-Axis using iOS 8.1. 我刚刚在我的iPhone上访问了这个网站,并且使用iOS 8.1在X-Axis上轻松滚动表单。 I also went to your site using iOS 6.1.6 on a 4th generation iPod touch. 我还使用iOS 6.1.6在第4代iPod touch上访问了您的网站。 On this older version of Safari, the web form was still able to load properly and scroll easily on the X-axis. 在这个旧版本的Safari中,Web表单仍然能够正确加载并在X轴上轻松滚动。

If you are having issues with your webpage, it could be a bug specific to your version of iOS or Safari. 如果您的网页出现问题,则可能是您的iOS或Safari版本特有的错误。 But I have not had any issues, the scrolling is smooth and works consistently. 但我没有遇到任何问题,滚动顺畅且工作一致。 Hopefully this outside test was of help to you. 希望这个外部测试对你有所帮助。 Good luck and cheers! 祝你好运和欢呼!

You may want to make the form 'flexible' instead. 您可能希望将表单设置为“灵活”。 Try using a percentage width in your CSS. 尝试在CSS中使用百分比宽度。 For example width:10%; 例如width:10%;

    .class-name{
     overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
}

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

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