如何向 iPhone 网站添加滚动条?
我创建了一个针对 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用一些 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.