类似 iPhone 的 jQuery 滚动条
我试图找到一个看起来像 iPhone 滚动条的 jQuery 滚动条:一个简单的黑色滚动条,没有向上或向下按钮。我找到了一些脚本,但大多数脚本的功能往往超出了我的需要。我基本上有一个固定高度的 div,设置在 overflow:auto
上,我想应用这个滚动条。帮助将不胜感激!
I'm trying to find a jQuery scrollbar that looks like the one of the iPhone: a simple black bar without the up or down buttons. I've found a few scripts but most tend to do so much more than I need. I basically have a div with a fixed height that is set on overflow:auto
to which I would like to apply this scrollbar. Help would greatly be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Matteo Spinelli 的 中有一个类似 iPhone 的滚动条iScroll 库。您应该尝试看看是否可以采用它来满足您的需求。
Matteo Spinelli has an iPhone-like scrollbar inside of his iScroll library. You should try looking into whether or not you can adopt it to your needs.
您的浏览器有什么要求?
您应该尽量避免使用 JavaScript 解决方案,因为它们会增加页面的复杂性。如果第三方滚动条 javascript 库损坏,您将必须自己调试它(曾经在那里做过)。
Chrome 完全支持 CSS3 滚动条,这样的东西应该能让 iPhone 像滚动条一样
IE 允许使用供应商特定标签设置滚动条样式,但它非常有限。例如:
这是一个带有样式滚动条的 jsFiddle:
http://jsfiddle.net/APmLZ/3/
What are your browser requirements?
You should try to avoid javascript solutions since they will increase the complexity of your page. If a third-party scrollbar javascript library breaks, you will have to debug it yourself (been there, done that).
Chrome has full support for CSS3 scrollbars, something like this should make an iPhone like scrollbar
IE allows styling scrollbars with vendor specific tags, but its very limited. e.g.:
Here is a jsFiddle with the styled scrollbars:
http://jsfiddle.net/APmLZ/3/