美文网首页
《H5 App开发》苹果机没有滚动条解决方案

《H5 App开发》苹果机没有滚动条解决方案

作者: 二爷V | 来源:发表于2018-12-17 17:24 被阅读0次

    有时候我们移动端,安卓机能够显示滚动条,并且可以滑动,但是苹果机却没有滚动条,并且不能滑动,我们只需要加overflow-y: scroll;样式

    推荐把这句代码一起加上 -webkit-overflow-scrolling: touch; 这句代码可以使ios上面的滚动条滑动着更流畅

    注意:谷歌浏览器不支持此方法,只有ios支持

    <style>

      div {

        position: fixed;

        left: 0;

        right: 0;

        top: 0;

        bottom: 0;

        -webkit-overflow-scrolling: touch;

        /* 当手指从触摸屏上移开,会保持一段时间的滚动 */

        overflow-y: scroll;

      }

      iframe {

        width: 100%;

        height: 100%;

      }

    </style>

    </head>


    <body>

      <div>

        <iframe frameborder="0" src="gamelist.html" name="lobby" scrolling="yes"></iframe>

      </div>

    </body>

    相关文章

      网友评论

          本文标题:《H5 App开发》苹果机没有滚动条解决方案

          本文链接:https://www.haomeiwen.com/subject/fhpckqtx.html