如何向 iPhone 网站添加滚动条?

发布于 2024-08-18 04:57:41 字数 197 浏览 8 评论 0原文

我创建了一个针对 iPhone 进行了优化的网站的迷你版本,但在其中一个页面上,我的容器中有一个滚动条,在计算机上查看时它会显示,但在 iPhone 上根本不会显示……我需要什么特殊的魔法吗? CSS 很简单:

#container {
  overflow-x: hidden;
  overflow-y: scroll;
}

I created a mini-version of a site that's been optimized for the iPhone, but on one of the pages, I have a scrollbar in a container, and it shows up when looking at it on the computer, but not at all on the iphone... Is there some kind of special magic that I need or something? The css is simple:

#container {
  overflow-x: hidden;
  overflow-y: scroll;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赠意 2024-08-25 04:57:41

您必须使用一些 javascript,例如 jScrollPane,或者告诉用户使用两根手指滚动。 iPhone 上没有传统的滚动条。

You will have to use some javascript, such as jScrollPane, or tell users to use two fingers to scroll. There are no traditional scrollbars on the iPhone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文